Top Description Fields Constructors Methods
net.sf.ehcache.search.attribute

public sealed Enum AttributeType

extends Enum<AttributeType>
Class Inheritance
Imports
java.util.Collections, .HashMap, .Map, .Set, net.sf.ehcache.search.SearchException

Defines the legal set of runtime types for search attributes
Author
teck

Field Summary

Modifier and TypeField and Description
public static final AttributeType
BOOLEAN

Boolean type

public static final AttributeType
BYTE

Byte type

public static final AttributeType
CHAR

Character type

public static final AttributeType
DATE

Date type

public static final AttributeType
DOUBLE

Double type

public static final AttributeType
ENUM

Enum type

public static final AttributeType
FLOAT

Float type

public static final AttributeType
INT

Integer type

public static final AttributeType
LONG

Long type

private static final Map<Class<?>, AttributeType>
public static final AttributeType
SHORT

Short type

public static final AttributeType
SQL_DATE

SQL Date type

public static final AttributeType
STRING

String type

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Set<Class<?>>

Returns:

all supported built-in types
getSupportedJavaTypes
()

public boolean

Returns:

true if this type is comparable
isComparable
()

Is this type comparable?

public static boolean

Returns:

true if the given value is valid as a search attribute
isSupportedType
(Object value)

Test the given value to see if it is a legal type

private static String
type(Object value)

public static AttributeType

Returns:

the attribute type for this value
typeFor
(String
the attribute name (only meaningful to message if exception thrown)
name
,
Object
the value to lookup the type for
value
)

Get the appropriate @{link AttributeType enum for the given object value.

public static AttributeType

Returns:

the attribute type for this value
typeFor
(Class<?> c)

Get the appropriate @{link AttributeType enum for the given Java Class

private static AttributeType
public abstract void
validateValue(String
the attribute name (only meaningful to message if exception thrown)
name
,
Object
the value to validate against this type
value
)

Validate that the given value is in fact of the correct type

public static AttributeType
public static AttributeType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

BOOLEANback to summary
public static final AttributeType BOOLEAN

Boolean type

BYTEback to summary
public static final AttributeType BYTE

Byte type

CHARback to summary
public static final AttributeType CHAR

Character type

DATEback to summary
public static final AttributeType DATE

Date type

DOUBLEback to summary
public static final AttributeType DOUBLE

Double type

ENUMback to summary
public static final AttributeType ENUM

Enum type

FLOATback to summary
public static final AttributeType FLOAT

Float type

INTback to summary
public static final AttributeType INT

Integer type

LONGback to summary
public static final AttributeType LONG

Long type

MAPPINGSback to summary
private static final Map<Class<?>, AttributeType> MAPPINGS
SHORTback to summary
public static final AttributeType SHORT

Short type

SQL_DATEback to summary
public static final AttributeType SQL_DATE

SQL Date type

STRINGback to summary
public static final AttributeType STRING

String type

Constructor Detail

AttributeTypeback to summary
private AttributeType()

Method Detail

getSupportedJavaTypesback to summary
public static Set<Class<?>> getSupportedJavaTypes()
Returns:Set<Class<?>>

all supported built-in types

isComparableback to summary
public boolean isComparable()

Is this type comparable?

Returns:boolean

true if this type is comparable

isSupportedTypeback to summary
public static boolean isSupportedType(Object value)

Test the given value to see if it is a legal type

Returns:boolean

true if the given value is valid as a search attribute

typeback to summary
private static String type(Object value)
typeForback to summary
public static AttributeType typeFor(String name, Object value) throws SearchException

Get the appropriate @{link AttributeType enum for the given object value.

Parameters
name:String

the attribute name (only meaningful to message if exception thrown)

value:Object

the value to lookup the type for

Returns:AttributeType

the attribute type for this value

Exceptions
SearchException:
if the given value is not valid for a search attribute
typeForback to summary
public static AttributeType typeFor(Class<?> c)

Get the appropriate @{link AttributeType enum for the given Java Class

Returns:AttributeType

the attribute type for this value

typeForOrNullback to summary
private static AttributeType typeForOrNull(Object value)
validateValueback to summary
public abstract void validateValue(String name, Object value) throws SearchException

Validate that the given value is in fact of the correct type

Parameters
name:String

the attribute name (only meaningful to message if exception thrown)

value:Object

the value to validate against this type

Exceptions
SearchException:
if the given value is not a valid instance of this type
valueOfback to summary
public static AttributeType valueOf(String name)
valuesback to summary
public static AttributeType[] values()