Class AbstractDeclaredStatement.WithRawStringArgument

All Implemented Interfaces:
DeclaredStatement<String>, ModelStatement<String>
Direct Known Subclasses:
AbstractDeclaredStatement.WithRawStringArgument.WithSubstatements, EmptyBitStatement, EmptyContactStatement, EmptyDefaultStatement, EmptyDescriptionStatement, EmptyErrorAppTagStatement, EmptyErrorMessageStatement, EmptyOrganizationStatement, EmptyPrefixStatement, EmptyPresenceStatement, EmptyReferenceStatement, EmptyUnitsStatement
Enclosing class:
AbstractDeclaredStatement<A>

public abstract static class AbstractDeclaredStatement.WithRawStringArgument extends AbstractDeclaredStatement.WithRawArgument<String>
  • Constructor Details

    • WithRawStringArgument

      protected WithRawStringArgument(String rawArgument)
  • Method Details

    • argument

      public final String argument()
      Description copied from interface: ModelStatement
      Returns statement argument.
      Returns:
      statement argument.
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public final String toString()
      Overrides:
      toString in class Object
    • addToStringAttributes

      protected MoreObjects.ToStringHelper addToStringAttributes(MoreObjects.ToStringHelper helper)
    • maskList

      protected static final @NonNull Object maskList(ImmutableList<?> list)
      Utility method for squashing singleton lists into single objects. This is a CPU/mem trade-off, which we are usually willing to make: for the cost of an instanceof check we can save one object and re-create it when needed. The inverse operation is #unmaskSubstatements(Object)}.
      Parameters:
      list - list to mask
      Returns:
      Masked list
      Throws:
      NullPointerException - if list is null
    • unmaskList

      protected static final <T> @NonNull ImmutableList<T> unmaskList(@NonNull Object masked, @NonNull Class<T> type)
      Utility method for recovering singleton lists squashed by maskList(ImmutableList).
      Parameters:
      masked - list to unmask
      Returns:
      Unmasked list
      Throws:
      NullPointerException - if any argument is null
      ClassCastException - if masked object does not match expected class
    • maskSet

      protected static final @NonNull Object maskSet(ImmutableSet<?> set)
    • unmaskSet

      protected static final <T> @NonNull ImmutableSet<T> unmaskSet(@NonNull Object masked, @NonNull Class<T> type)