Skip to content

Class StringField<V extends @Nullable Object>

Javadoc 27 generates this reference during each site build from the exported packages and the annotation processor. The Java guide shows the API in use.

java.lang.Object
dev.gecode.iris.Field<V>
dev.gecode.iris.build.StringField<V>
Type Parameters:
V - the Java type of the entry's value
All Implemented Interfaces:
Domain<StringExpr>, Expr, StringExpr, TextualExpr
public final class StringField<V extends @Nullable Object> extends Field<V> implements StringExpr
A handle of a string entry. In a builder it is an expression; after reading, data.get(handle) returns the entry as V.

The factories such as Iris.string0(String) make handles that any builder may use: the first use in a builder declares the name with the handle's type, depth and presence, and Builder.build() checks every definition against them.

  • Method Details

    • optional

      public StringField<@Nullable V> optional()
      Returns this handle for an entry that may be absent, for which get returns null.
      Returns:
      this handle for an entry that may be absent, for which get returns null
      Throws:
      IllegalStateException - for a handle from forward or a definition, whose presence its builder fixed
    • readFrom

      protected V readFrom(Data data)
      Description copied from class: Field
      Reads the entry of this handle from data.
      Specified by:
      readFrom in class Field<V extends @Nullable Object>
      Parameters:
      data - the data that a read produced
      Returns:
      the value of the entry, or null for an absent entry of an optional handle
    • toString

      public String toString()
      Overrides:
      toString in class Object