- java.lang.Object
-
- swim.structure.Form<Item>
-
- swim.structure.form.ItemForm
-
public final class ItemForm extends Form<Item>
Fall-through "transformation" between a structuralItem
and a nominalItem
. Bothmold(swim.structure.Item)
andcast(swim.structure.Item)
simply return theItem
argument itself.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Item
cast(Item item)
Converts a structurally typeditem
into a nominally typed Java object.Item
mold(Item item)
Converts a nominally typed Javaobject
into its structurally typed equivalent.Class<Item>
type()
Returns the reifiedClass
of typeT
.Item
unit()
Returns a default–possiblynull
–value of typeT
.Form<Item>
unit(Item unit)
Returns a version of thisForm
with the givenunit
value.-
Methods inherited from class swim.structure.Form
cast, forArray, forBigInteger, forBoolean, forBuiltin, forByte, forByteBuffer, forCharacter, forClass, forClass, forCollection, forDouble, forFloat, forInteger, forItem, forList, forLong, forMap, forMap, forNumber, forSet, forShort, forString, forValue, isBuiltin, mold, tag, tag
-
-
-
-
Constructor Detail
-
ItemForm
public ItemForm(Item unit)
-
-
Method Detail
-
unit
public Item unit()
Description copied from class:Form
Returns a default–possiblynull
–value of typeT
. Used as the fallback return value whencoercing
an invalid structural value.
-
unit
public Form<Item> unit(Item unit)
Description copied from class:Form
Returns a version of thisForm
with the givenunit
value.
-
type
public Class<Item> type()
Description copied from class:Form
Returns the reifiedClass
of typeT
.
-
mold
public Item mold(Item item)
Description copied from class:Form
Converts a nominally typed Javaobject
into its structurally typed equivalent. The returnedItem
must never benull
.
-
-