Class AbstractDeclaredStatement.WithRawArgument<A>

All Implemented Interfaces:
DeclaredStatement<A>, ModelStatement<A>
Direct Known Subclasses:
AbstractDeclaredStatement.WithArgument, AbstractDeclaredStatement.WithRawArgument.WithSubstatements, AbstractDeclaredStatement.WithRawStringArgument, EmptyKeyStatement, RegularKeyStatement
Enclosing class:
AbstractDeclaredStatement<A>

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

    • WithRawArgument

      protected WithRawArgument(String rawArgument)
  • Method Details

    • rawArgument

      public final String rawArgument()
      Description copied from interface: DeclaredStatement
      Returns statement argument as was present in original source.
      Returns:
      statement argument as was present in original source or null, if statement does not take 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)