java.lang.Object
com.cryptoalgo.oursql.model.db.data.Container<T>
- Direct Known Subclasses:
BitContainer,BooleanContainer,NumberContainer,PlaceholderContainer,StringContainer,TIDContainer
An immutable "box" for holding different types of data
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFinalValue(String input) Get the final value from a user input for committinggetInstance(String forType) static String[]getTypes()Get supported SQL typesgetValue()Get the stored value in this containerbooleanabstract booleanGet an escaped string representation of the value in this container.abstract StringtoString()protected abstract T"Unbox" a raw string to the boxed type
-
Field Details
-
value
Value stored in container
-
-
Constructor Details
-
Container
Default constructor that unboxes a raw string value into the container- Parameters:
val- Raw string value to unbox
-
-
Method Details
-
getValue
Get the stored value in this container- Returns:
- The stored value in this container
-
getFinalValue
Get the final value from a user input for committing- Parameters:
input- Raw input- Returns:
- Output to be used for the commit operation
-
unbox
"Unbox" a raw string to the boxed type- Parameters:
val- Raw string for unboxing- Returns:
- Boxed type representing the string
-
isValid
- Parameters:
value- Value to be checked- Returns:
- true if
valuecan be cast to the type of this container
-
isEditable
public boolean isEditable()- Returns:
- True if editing fields of this container type should be allowed
-
getTypes
Get supported SQL types- Returns:
- A string array of supported SQL types
-
getInstance
- Parameters:
forType- SQL type to get container fo- Returns:
- Container class appropriate for type
-
toString
-
toSQLString
Get an escaped string representation of the value in this container. Value contained should be escaped and ready for insertion into a SQL query.- Returns:
- Escaped string representation of the value in this container
-