@Test public void testMatch() throws Exception { Scopes scopes1 = Scopes.DEFAULT; Scopes scopes2 = Scopes.from("scope"); assert !scopes1.match(scopes2); assert !scopes2.match(scopes1); scopes1 = Scopes.from("scope1", "scope2"); scopes2 = Scopes.from("scope2"); assert scopes1.match(scopes2); assert !scopes2.match(scopes1); scopes1 = Scopes.NONE; scopes2 = Scopes.from("scope2"); assert !scopes1.match(scopes2); assert scopes2.match(scopes1); scopes1 = Scopes.ANY; scopes2 = Scopes.from("scope2"); assert scopes1.match(scopes2); assert !scopes2.match(scopes1); }
public boolean match(Scopes other) { if (isNoneScope()) return false; if (isAnyScope()) return true; if (other == null || other.isNoneScope()) return true; if (other.isAnyScope()) return false; return scopes.containsAll(other.scopes); }
Scopes { public boolean match(Scopes other) { if (isNoneScope()) return false; if (isAnyScope()) return true; if (other == null || other.isNoneScope()) return true; if (other.isAnyScope()) return false; return scopes.containsAll(other.scopes); } }
Scopes { public boolean match(Scopes other) { if (isNoneScope()) return false; if (isAnyScope()) return true; if (other == null || other.isNoneScope()) return true; if (other.isAnyScope()) return false; return scopes.containsAll(other.scopes); } private  Scopes(String[] scopes, boolean escape); }
Scopes { public boolean match(Scopes other) { if (isNoneScope()) return false; if (isAnyScope()) return true; if (other == null || other.isNoneScope()) return true; if (other.isAnyScope()) return false; return scopes.containsAll(other.scopes); } private  Scopes(String[] scopes, boolean escape); static Scopes from(String... scopes); boolean equals(Object obj); int hashCode(); boolean match(Scopes other); boolean weakMatch(Scopes other); String[] asStringArray(); boolean isNoneScope(); boolean isAnyScope(); boolean isDefaultScope(); String toString(); }
Scopes { public boolean match(Scopes other) { if (isNoneScope()) return false; if (isAnyScope()) return true; if (other == null || other.isNoneScope()) return true; if (other.isAnyScope()) return false; return scopes.containsAll(other.scopes); } private  Scopes(String[] scopes, boolean escape); static Scopes from(String... scopes); boolean equals(Object obj); int hashCode(); boolean match(Scopes other); boolean weakMatch(Scopes other); String[] asStringArray(); boolean isNoneScope(); boolean isAnyScope(); boolean isDefaultScope(); String toString(); static final Scopes DEFAULT; static final Scopes NONE; static final Scopes ANY; }