- java.lang.Object
-
- swim.structure.Form<Object>
-
- swim.structure.form.PolyForm
-
-
Constructor Summary
Constructors Constructor Description PolyForm()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PolyFormaddClass(Class<?> newClass)PolyFormaddClasses(Class<?>... newClasses)PolyFormaddForm(Form<?> newForm)PolyFormaddForms(Form<?>... newForms)PolyFormaddType(Type genericType)PolyFormaddTypes(Type... newGenericTypes)Objectcast(Item item)Converts a structurally typediteminto a nominally typed Java object.Objectcast(Item item, Object object)Converts a structurally typediteminto a nominally typed Java object based on the provided prototypeobject.protected ObjectcastBool(Bool value)protected ObjectcastData(Data value)protected ObjectcastNum(Num value)protected ObjectcastRecord(Record value)protected ObjectcastRecord(Record value, Object object)protected ObjectcastText(Text value)PolyFormclone()<T> Form<T>formForClass(Class<?> type)<T> Form<T>formForTag(String tag)<T> Form<T>formForType(Type genericType)Itemmold(Object object)Converts a nominally typed Javaobjectinto its structurally typed equivalent.Itemmold(Object object, Item item)Converts a nominally typed Javaobjectinto its structurally typed equivalent based on the provided prototypeitem.protected ItemmoldArray(Object[] object)protected ItemmoldArray(Object[] object, Item item)protected ItemmoldBoolean(Boolean object)protected ItemmoldBoolean(Boolean object, Item item)protected ItemmoldByteBuffer(ByteBuffer object)protected ItemmoldByteBuffer(ByteBuffer object, Item item)protected ItemmoldCharacter(Character object)protected ItemmoldCharacter(Character object, Item item)protected ItemmoldCollection(Collection<?> object)protected ItemmoldCollection(Collection<?> object, Item item)protected ItemmoldMap(Map<?,?> object)protected ItemmoldMap(Map<?,?> object, Item item)protected ItemmoldNumber(Number object)protected ItemmoldNumber(Number object, Item item)protected ItemmoldString(String object)protected ItemmoldString(String object, Item item)<T> Form<T>reflectClass(Class<?> type)<T> ClassForm<T>reflectClassForm(Class<?> type)<T> ClassForm<T>reflectClassForm(Class<?> type, String tag)<T> ClassForm<T>reflectClassForm(Class<?> type, String tag, T unit)<T> ClassForm<T>reflectClassForm(ClassForm<T> classForm)<T> Form<T>reflectClassName(String className)StringreflectClassTag(Class<?> type)<T> ClassForm<T>reflectField(ClassForm<T> classForm, Field field)<T> ClassForm<T>reflectFields(ClassForm<T> classForm, Class<?> type)Class<?>type()Returns the reifiedClassof typeT.Objectunit()Returns a default–possiblynull–value of typeT.PolyFormunit(Object unit)Returns a version of thisFormwith the givenunitvalue.-
Methods inherited from class swim.structure.Form
forArray, forBigInteger, forBoolean, forBuiltin, forByte, forByteBuffer, forCharacter, forClass, forClass, forCollection, forDouble, forFloat, forInteger, forItem, forList, forLong, forMap, forMap, forNumber, forSet, forShort, forString, forValue, isBuiltin, tag, tag
-
-
-
-
Method Detail
-
unit
public final Object unit()
Description copied from class:FormReturns a default–possiblynull–value of typeT. Used as the fallback return value whencoercingan invalid structural value.
-
unit
public PolyForm unit(Object unit)
Description copied from class:FormReturns a version of thisFormwith the givenunitvalue.
-
type
public final Class<?> type()
Description copied from class:FormReturns the reifiedClassof typeT.
-
mold
public Item mold(Object object, Item item)
Description copied from class:FormConverts a nominally typed Javaobjectinto its structurally typed equivalent based on the provided prototypeitem. The passed-initemis assumed to be non-null. The returnedItemmust never benull.
-
mold
public Item mold(Object object)
Description copied from class:FormConverts a nominally typed Javaobjectinto its structurally typed equivalent. The returnedItemmust never benull.
-
moldByteBuffer
protected Item moldByteBuffer(ByteBuffer object, Item item)
-
moldByteBuffer
protected Item moldByteBuffer(ByteBuffer object)
-
moldCollection
protected Item moldCollection(Collection<?> object, Item item)
-
moldCollection
protected Item moldCollection(Collection<?> object)
-
cast
public Object cast(Item item, Object object)
Description copied from class:FormConverts a structurally typediteminto a nominally typed Java object based on the provided prototypeobject. The passed-initemis assumed to be non-null. The passed-in prototypeobjectmay benull.
-
cast
public Object cast(Item item)
Description copied from class:FormConverts a structurally typediteminto a nominally typed Java object. The passed-initemis assumed to be non-null.
-
-