public final class IdentifierSet extends Object
Rules in this set may be in the following forms:
.*
, like squareup.protos.person.*
. This matches
types and services defined in the package and its descendant packages.
squareup.protos.person.Person
.
squareup.protos.person.Person#address
. Members may be fields, enum
constants or RPCs.
An identifier set populated with Movie
and Actor#name
contains all members of
Movie
(such as Movie#name
and Movie#release_date
). It contains the type
Actor
and one member Actor#name
, but not Actor#birth_date
or Actor#oscar_count
.
This set has included identifiers and excluded identifiers, with excludes taking
precedence over includes. That is, if a type Movie
is in both the includes and the
excludes, it is not contained in the set.
If the includes set is empty, that implies that all elements should be included. Use this to exclude unwanted types and members without also including everything else.
Despite the builder, instances of this class are not safe for concurrent use.
Modifier and Type | Class and Description |
---|---|
static class |
IdentifierSet.Builder |
Modifier and Type | Method and Description |
---|---|
boolean |
excludes(ProtoMember protoMember)
Returns true if
protoMember should be excluded. |
boolean |
excludes(ProtoType type)
Returns true if
type should be excluded, even if it is a transitive dependency of a
root. |
boolean |
includes(ProtoMember protoMember)
Returns true if
protoMember is a root. |
boolean |
includes(ProtoType type)
Returns true if
type is a root. |
boolean |
isEmpty() |
Set<String> |
unusedExcludes() |
Set<String> |
unusedIncludes() |
public boolean isEmpty()
public boolean includes(ProtoType type)
type
is a root.public boolean includes(ProtoMember protoMember)
protoMember
is a root.public boolean excludes(ProtoType type)
type
should be excluded, even if it is a transitive dependency of a
root. In that case, the referring member is also excluded.public boolean excludes(ProtoMember protoMember)
protoMember
should be excluded.Copyright © 2013–2016 Square, Inc.. All rights reserved.