ModeShape Distribution 3.0.0.Beta4

org.infinispan.schematic.document
Enum JsonSchema.Type

java.lang.Object
  extended by java.lang.Enum<JsonSchema.Type>
      extended by org.infinispan.schematic.document.JsonSchema.Type
All Implemented Interfaces:
Serializable, Comparable<JsonSchema.Type>
Enclosing class:
JsonSchema

public static enum JsonSchema.Type
extends Enum<JsonSchema.Type>

The enumeration representing the standard types used in the JSON Schema (draft) specification. Type.

Since:
5.1

Enum Constant Summary
ANY
           
ARRAY
           
BOOLEAN
           
INTEGER
           
NULL
           
NUMBER
           
OBJECT
           
STRING
           
UNION
           
UNKNOWN
           
 
Method Summary
static JsonSchema.Type byName(String name)
          Find the type enumeration literal given the (case-insensitive) name.
 Object convertValueFrom(Object actualValue, JsonSchema.Type actualType)
          Attempt to convert the supplied value (with the given type) into a value compatible with this type.
 boolean isEquivalent(JsonSchema.Type other)
          Determine whether this type is equivalent to the supplied type.
 String toString()
           
static JsonSchema.Type typeFor(Object value)
          Determine the type for the given value.
static EnumSet<JsonSchema.Type> typesWithNames(Object typeName)
          Obtain the set of types given the supplied name or iterable container of names.
static JsonSchema.Type valueOf(String name)
          Returns the enum constant of this type with the specified name.
static JsonSchema.Type[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

STRING

public static final JsonSchema.Type STRING

NUMBER

public static final JsonSchema.Type NUMBER

INTEGER

public static final JsonSchema.Type INTEGER

BOOLEAN

public static final JsonSchema.Type BOOLEAN

OBJECT

public static final JsonSchema.Type OBJECT

ARRAY

public static final JsonSchema.Type ARRAY

NULL

public static final JsonSchema.Type NULL

ANY

public static final JsonSchema.Type ANY

UNION

public static final JsonSchema.Type UNION

UNKNOWN

public static final JsonSchema.Type UNKNOWN
Method Detail

values

public static JsonSchema.Type[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (JsonSchema.Type c : JsonSchema.Type.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static JsonSchema.Type valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

toString

public String toString()
Overrides:
toString in class Enum<JsonSchema.Type>

byName

public static JsonSchema.Type byName(String name)
Find the type enumeration literal given the (case-insensitive) name.

Parameters:
name - the case-independent name of the type
Returns:
the type, or null if there is no such type

isEquivalent

public boolean isEquivalent(JsonSchema.Type other)
Determine whether this type is equivalent to the supplied type.

Parameters:
other - the type to be compared with this type
Returns:
true if the types are equivalent, or false otherwise

convertValueFrom

public Object convertValueFrom(Object actualValue,
                               JsonSchema.Type actualType)
Attempt to convert the supplied value (with the given type) into a value compatible with this type.

Parameters:
actualValue - the value to be converted; may be null
actualType - the type of the value; may be null
Returns:
the converted value, or null if the value could not be converted to this type

typeFor

public static JsonSchema.Type typeFor(Object value)
Determine the type for the given value.

Parameters:
value - the field value
Returns:
the corresponding type for the value; never null

typesWithNames

public static EnumSet<JsonSchema.Type> typesWithNames(Object typeName)
Obtain the set of types given the supplied name or iterable container of names.

Parameters:
typeName - the String or Symbol representation of a single type name, or an Iterable&?> list of names
Returns:
the set of types that correspond to the supplied names; never null but possibly an empty set

ModeShape Distribution 3.0.0.Beta4

Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.