public int compareTo(ComponentId other) { //anonymous must never be equal to non-anonymous if (isAnonymous() ^ other.isAnonymous()) { return isAnonymous() ? -1 : 1; } return spec.compareTo(other.spec); }
public boolean equals(Object o) { if (o==this) return true; if ( ! (o instanceof ComponentId)) return false; ComponentId c = (ComponentId) o; if (isAnonymous() || c.isAnonymous()) return false; return c.stringValue().equals(stringValue); }
public boolean isExplicit() { return !getId().isAnonymous(); }
/** * Creates a new query profile from an id. * The query profile can be modified freely (but not accessed) until it is {@link #freeze frozen}. * At that point it becomes readable but unmodifiable, which it stays until it goes out of reference. */ public QueryProfile(ComponentId id) { super(id); if ( ! id.isAnonymous()) validateName(id.getName()); }
public ComponentSpecification toSpecification() { if (isAnonymous()) throw new RuntimeException("Can't generate a specification for an anonymous component id."); return new ComponentSpecification(getName(), getVersion().toSpecification(), getNamespace()); }
/** * Creates a new query profile from an id. */ public CompiledQueryProfile(ComponentId id, QueryProfileType type, DimensionalMap<CompoundName, Object> entries, DimensionalMap<CompoundName, QueryProfileType> types, DimensionalMap<CompoundName, Object> references, DimensionalMap<CompoundName, Object> unoverridables, CompiledQueryProfileRegistry registry) { super(id); this.registry = registry; if (type != null) type.freeze(); this.type = type; this.entries = entries; this.types = types; this.references = references; this.unoverridables = unoverridables; if ( ! id.isAnonymous()) validateName(id.getName()); }