public enum OType extends Enum<OType>
Enum Constant and Description |
---|
ANY |
BINARY |
BOOLEAN |
BYTE |
CUSTOM |
DATE |
DATETIME |
DECIMAL |
DOUBLE |
EMBEDDED |
EMBEDDEDLIST |
EMBEDDEDMAP |
EMBEDDEDSET |
FLOAT |
INTEGER |
LINK |
LINKBAG |
LINKLIST |
LINKMAP |
LINKSET |
LONG |
SHORT |
STRING |
TRANSIENT |
Modifier and Type | Field and Description |
---|---|
protected Class<?>[] |
allowAssignmentFrom |
protected Set<OType> |
castable |
protected int |
id |
protected Class<?> |
javaDefaultType |
protected String |
name |
protected static OType[] |
TYPES |
protected static Map<Class<?>,OType> |
TYPES_BY_CLASS |
protected static OType[] |
TYPES_BY_ID |
Modifier and Type | Method and Description |
---|---|
double |
asDouble(Object iValue)
Convert the input object to a double.
|
float |
asFloat(Object iValue)
Convert the input object to a float.
|
int |
asInt(Object iValue)
Convert the input object to an integer.
|
long |
asLong(Object iValue)
Convert the input object to a long.
|
String |
asString(Object iValue)
Deprecated.
|
static Number[] |
castComparableNumber(Number context,
Number max) |
static Object |
convert(Object iValue,
Class<?> iTargetClass)
Convert types based on the iTargetClass parameter.
|
static OType |
getById(byte iId)
Return the type by ID.
|
Set<OType> |
getCastable() |
Class<?> |
getDefaultJavaType() |
int |
getId()
Get the identifier of the type.
|
Class<?>[] |
getJavaTypes()
Deprecated.
|
String |
getName() |
static OType |
getTypeByClass(Class<?> iClass)
Return the correspondent type by checking the "assignability" of the class received as
parameter.
|
static OType |
getTypeByValue(Object value) |
static Number |
increment(Number a,
Number b) |
boolean |
isEmbedded() |
boolean |
isLink() |
boolean |
isList() |
boolean |
isMultiValue() |
static boolean |
isSimpleType(Object iObject) |
static OType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static OType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final OType BOOLEAN
public static final OType INTEGER
public static final OType SHORT
public static final OType LONG
public static final OType FLOAT
public static final OType DOUBLE
public static final OType DATETIME
public static final OType STRING
public static final OType BINARY
public static final OType EMBEDDED
public static final OType EMBEDDEDLIST
public static final OType EMBEDDEDSET
public static final OType EMBEDDEDMAP
public static final OType LINK
public static final OType LINKLIST
public static final OType LINKSET
public static final OType LINKMAP
public static final OType BYTE
public static final OType TRANSIENT
public static final OType DATE
public static final OType CUSTOM
public static final OType DECIMAL
public static final OType LINKBAG
public static final OType ANY
protected static final OType[] TYPES
protected static final OType[] TYPES_BY_ID
protected final String name
protected final int id
protected final Class<?> javaDefaultType
protected final Class<?>[] allowAssignmentFrom
public static OType[] values()
for (OType c : OType.values()) System.out.println(c);
public static OType valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static OType getById(byte iId)
iId
- The id to searchpublic final int getId()
Enum.ordinal()
for guarantee a
cross code version identifier.public static OType getTypeByClass(Class<?> iClass)
iClass
- Class to checkpublic static boolean isSimpleType(Object iObject)
public static Object convert(Object iValue, Class<?> iTargetClass)
iValue
- Value to convertiTargetClass
- Expected classpublic int asInt(Object iValue)
iValue
- Any type supportedpublic long asLong(Object iValue)
iValue
- Any type supportedpublic float asFloat(Object iValue)
iValue
- Any type supportedpublic double asDouble(Object iValue)
iValue
- Any type supported@Deprecated public String asString(Object iValue)
iValue
- Any type supportedpublic boolean isMultiValue()
public boolean isList()
public boolean isLink()
public boolean isEmbedded()
public Class<?> getDefaultJavaType()
@Deprecated public Class<?>[] getJavaTypes()
public String getName()
Copyright © 2009–2020 OrientDB. All rights reserved.