Interface HasFields<T extends HasFields<T>>

    • Method Detail

      • add

        default T add​(Field field)
        Adds the specified Field to this model.
        Parameters:
        field - the new child
        Returns:
        a reference to this
      • field

        default T field​(String name,
                        String type)
        Creates a Field and adds it to this model. The field will be given the default modifiers for this type, for an example, a Class will be public final. The type will be constructed using the default implementation.
        Parameters:
        name - the name of the field
        type - the type of the field
        Returns:
        a reference to this
        Since:
        2.5
      • field

        default T field​(String name,
                        Type type)
        Creates a Field and adds it to this model. The field will be given the default modifiers for this type, for an example, a Class will be public final.
        Parameters:
        name - the name of the field
        type - the type of the field
        Returns:
        a reference to this
        Since:
        2.5
      • constant

        default T constant​(String name,
                           Type type,
                           Value<?> value)
        Creates a public final static Field with the specified value and adds it to this model.
        Parameters:
        name - the name of the field
        type - the type of the field
        value - the value of the field
        Returns:
        a reference to this
        Since:
        2.5
      • constant

        default T constant​(String name,
                           Type type,
                           String value)
        Creates a public final static Field with the specified value and adds it to this model.
        Parameters:
        name - the name of the field
        type - the type of the field
        value - the value of the field
        Returns:
        a reference to this
        Since:
        2.5
      • constant

        default T constant​(String name,
                           Type type,
                           Number value)
        Creates a public final static Field with the specified value and adds it to this model.
        Parameters:
        name - the name of the field
        type - the type of the field
        value - the value of the field
        Returns:
        a reference to this
        Since:
        2.5
      • constant

        default T constant​(String name,
                           Type type,
                           Boolean value)
        Creates a public final static Field with the specified value and adds it to this model.
        Parameters:
        name - the name of the field
        type - the type of the field
        value - the value of the field
        Returns:
        a reference to this
        Since:
        2.5
      • addAllFields

        default T addAllFields​(Collection<? extends Field> fields)
        Adds all the specified Field members to this model.
        Parameters:
        fields - the new children
        Returns:
        a reference to this
      • getFields

        List<Field> getFields()
        Returns a list of all the fields in this model.

        The list returned must be mutable for changes!

        Returns:
        all the fields