EntityVisibility

public final class EntityVisibility implements Serializable

The visibility of an entity type.

An entity can have one of the following visibility levels:

  1. NONE - the entity is not visible to the clients for reading;
  2. QUERY - the entity is visible for querying, but not for subscription;
  3. SUBSCRIBE - the entity is visible for subscription, but not for querying;
  4. FULL - the entity is visible for both subscription and querying.

The visibility of an entity is defined by the (entity) option. By default, any entity is has the NONE level except for projections, which have the FULL level.

Functions

Link copied to clipboard
public boolean canQuery()
Checks if the visibility level is sufficient for querying.
Link copied to clipboard
public boolean canSubscribe()
Checks if the visibility level is sufficient for subscription.
Link copied to clipboard
public boolean is(Visibility visibility)
Checks if the visibility is exactly of the given level.
Link copied to clipboard
public boolean isAsLeast(Visibility visibility)
Checks if the visibility is at least as allowing as the given one.
Link copied to clipboard
public boolean isNotNone()
Checks if the visibility level is not NONE.
Link copied to clipboard
public static Optional<EntityVisibility> of(Class<? extends EntityState> stateClass)
Obtains an instance of EntityVisibility for the given entity state class.
Link copied to clipboard
public String toString()