Package io.ebeaninternal.server.type
Class ScalarTypeJodaPeriod
- java.lang.Object
-
- io.ebeaninternal.server.type.ScalarTypeBase<T>
-
- io.ebeaninternal.server.type.ScalarTypeBaseVarchar<org.joda.time.Period>
-
- io.ebeaninternal.server.type.ScalarTypeJodaPeriod
-
- All Implemented Interfaces:
StringFormatter
,StringParser
,ScalarDataReader<org.joda.time.Period>
,ScalarType<org.joda.time.Period>
public class ScalarTypeJodaPeriod extends ScalarTypeBaseVarchar<org.joda.time.Period>
ScalarType for Joda Period stored as DB VARCHAR
-
-
Constructor Summary
Constructors Constructor Description ScalarTypeJodaPeriod()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.joda.time.Period
convertFromDbString(String dbValue)
Convert from DB string value to the target type.String
convertToDbString(org.joda.time.Period beanValue)
Convert to DB string from the target type.String
formatValue(org.joda.time.Period v)
Format the target type to a string.int
getLength()
Just return 0.org.joda.time.Period
parse(String value)
Parse from a formatted string value.-
Methods inherited from class io.ebeaninternal.server.type.ScalarTypeBaseVarchar
bind, convertFromMillis, format, getDocType, isDateTimeCapable, jsonRead, jsonWrite, read, readData, toBeanType, toJdbcType, writeData
-
Methods inherited from class io.ebeaninternal.server.type.ScalarTypeBase
asVersion, getJdbcType, getType, isBinaryType, isDirty, isJdbcNative, isMutable, loadIgnore
-
-
-
-
Constructor Detail
-
ScalarTypeJodaPeriod
public ScalarTypeJodaPeriod()
-
-
Method Detail
-
getLength
public int getLength()
Description copied from class:ScalarTypeBase
Just return 0.- Specified by:
getLength
in interfaceScalarType<org.joda.time.Period>
- Overrides:
getLength
in classScalarTypeBase<org.joda.time.Period>
-
formatValue
public String formatValue(org.joda.time.Period v)
Description copied from class:ScalarTypeBaseVarchar
Format the target type to a string.- Specified by:
formatValue
in interfaceScalarType<org.joda.time.Period>
- Specified by:
formatValue
in classScalarTypeBaseVarchar<org.joda.time.Period>
-
parse
public org.joda.time.Period parse(String value)
Description copied from class:ScalarTypeBaseVarchar
Parse from a formatted string value.- Specified by:
parse
in interfaceScalarType<org.joda.time.Period>
- Specified by:
parse
in interfaceStringParser
- Specified by:
parse
in classScalarTypeBaseVarchar<org.joda.time.Period>
-
convertFromDbString
public org.joda.time.Period convertFromDbString(String dbValue)
Description copied from class:ScalarTypeBaseVarchar
Convert from DB string value to the target type.- Specified by:
convertFromDbString
in classScalarTypeBaseVarchar<org.joda.time.Period>
-
convertToDbString
public String convertToDbString(org.joda.time.Period beanValue)
Description copied from class:ScalarTypeBaseVarchar
Convert to DB string from the target type.- Specified by:
convertToDbString
in classScalarTypeBaseVarchar<org.joda.time.Period>
-
-