java.lang.Object
org.opendaylight.yangtools.yang.model.api.meta.AbstractDeclaredStatement<A>
Type Parameters:
A - Argument type (Empty if statement does not have argument.)
All Implemented Interfaces:
DeclaredStatement<A>, ModelStatement<A>

public abstract non-sealed class AbstractDeclaredStatement<A> extends Object implements DeclaredStatement<A>
Abstract base class for DeclaredStatement implementations.
  • Constructor Details

    • AbstractDeclaredStatement

      public AbstractDeclaredStatement()
  • Method Details

    • unmaskList

      protected static final @NonNull com.google.common.collect.ImmutableList<? extends DeclaredStatement<?>> unmaskList(@NonNull Object masked)
      Utility method for recovering singleton lists squashed by maskList(ImmutableList).
      Parameters:
      masked - list to unmask
      Returns:
      Unmasked list
      Throws:
      NullPointerException - if masked is null
      ClassCastException - if masked object does not match DeclaredStatement
    • 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 com.google.common.base.MoreObjects.ToStringHelper addToStringAttributes(com.google.common.base.MoreObjects.ToStringHelper helper)
    • maskList

      protected static final @NonNull Object maskList(com.google.common.collect.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 com.google.common.collect.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(com.google.common.collect.ImmutableSet<?> set)
    • unmaskSet

      protected static final <T> @NonNull com.google.common.collect.ImmutableSet<T> unmaskSet(@NonNull Object masked, @NonNull Class<T> type)