public static < T > DataKey < T > create ( String name , Class < T > dataClass , boolean allowNull , T defaultValue ) { if ( dataClass . isPrimitive ( ) ) { throw new IllegalArgumentException ( "primitives are not supported - please use their corresponding wrappers" ) ; } if ( dataClass . isArray ( ) ) { throw new IllegalArgumentException ( "arrays are not supported - please use a list with their corresponding wrapper" ) ; } return new DataKey ( name , dataClass , allowNull , defaultValue ) ; }
creates a data key with the given name data type the given permission to allow null values and a default value . You can set the default value to null to signal that there should be no default value .