- java.lang.Object
-
- swim.structure.Form<Collection<T>>
-
- swim.structure.form.CollectionForm<T>
-
public final class CollectionForm<T> extends Form<Collection<T>>
-
-
Constructor Summary
Constructors Constructor Description CollectionForm(Class<?> type, Form<T> form)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<T>
cast(Item item)
Converts a structurally typeditem
into a nominally typed Java object.Collection<T>
cast(Item item, Collection<T> collection)
Converts a structurally typeditem
into a nominally typed Java object based on the provided prototypeobject
.Item
mold(Collection<T> collection)
Converts a nominally typed Javaobject
into its structurally typed equivalent.Item
mold(Collection<T> collection, Item item)
Converts a nominally typed Javaobject
into its structurally typed equivalent based on the provided prototypeitem
.Class<?>
type()
Returns the reifiedClass
of typeT
.Collection<T>
unit()
Returns a default–possiblynull
–value of typeT
.-
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, unit
-
-
-
-
Method Detail
-
unit
public Collection<T> unit()
Description copied from class:Form
Returns a default–possiblynull
–value of typeT
. Used as the fallback return value whencoercing
an invalid structural value.- Overrides:
unit
in classForm<Collection<T>>
-
type
public Class<?> type()
Description copied from class:Form
Returns the reifiedClass
of typeT
.- Specified by:
type
in classForm<Collection<T>>
-
mold
public Item mold(Collection<T> collection, Item item)
Description copied from class:Form
Converts a nominally typed Javaobject
into its structurally typed equivalent based on the provided prototypeitem
. The passed-initem
is assumed to be non-null
. The returnedItem
must never benull
.- Overrides:
mold
in classForm<Collection<T>>
-
mold
public Item mold(Collection<T> collection)
Description copied from class:Form
Converts a nominally typed Javaobject
into its structurally typed equivalent. The returnedItem
must never benull
.- Specified by:
mold
in classForm<Collection<T>>
-
cast
public Collection<T> cast(Item item, Collection<T> collection)
Description copied from class:Form
Converts a structurally typeditem
into a nominally typed Java object based on the provided prototypeobject
. The passed-initem
is assumed to be non-null
. The passed-in prototypeobject
may benull
.- Overrides:
cast
in classForm<Collection<T>>
-
cast
public Collection<T> cast(Item item)
Description copied from class:Form
Converts a structurally typeditem
into a nominally typed Java object. The passed-initem
is assumed to be non-null
.- Specified by:
cast
in classForm<Collection<T>>
-
-