Interface HasCode<T extends HasCode<T>>

  • Type Parameters:
    T - the extending type
    All Known Subinterfaces:
    Constructor, Initializer, InterfaceMethod, Method

    public interface HasCode<T extends HasCode<T>>
    A trait for models that contains code.
    Since:
    2.0
    Author:
    Emil Forslund
    • Method Detail

      • add

        default T add​(String row)
        Adds the specified row of code to this model. If the row contains new-line characters, the line will be broken apart on those characters and added using the add(java.lang.String...)-method.
        Parameters:
        row - the row
        Returns:
        a reference to this
      • add

        default T add​(String... rows)
        Adds all the specified rows to this model. If any of the specified rows contains a new-line character it will be broken apart on that character so that every row is in fact added as a separate string.
        Parameters:
        rows - the rows
        Returns:
        a reference to this
      • add

        default T add​(Stream<String> rows)
        Adds all the specified rows to this model. If any of the specified rows contains a new-line character it will be broken apart on that character so that every row is in fact added as a separate string.
        Parameters:
        rows - the rows
        Returns:
        a reference to this
      • getCode

        List<String> getCode()
        Returns a list of the code rows of this model.

        The list returned must be mutable for changes!

        Returns:
        the code rows