/** * Sets a delegate registry that will be used to satisfy lookups that cannot * be resolved from the local registry. * * @param delegate delegate registry. */ public void setDelegate(AltRegistry delegate) { Preconditions.checkState(!locked, "Registry is locked against changes"); this.delegate = delegate; }
private Builder check() { Preconditions.checkState(name != null, "Name must be set"); Preconditions.checkState(contentType != null, "contentType must be set"); return this; } }
/** * Sets a delegate registry that will be used to satisfy lookups that cannot * be resolved from the local registry. * * @param delegate delegate registry. */ public void setDelegate(AltRegistry delegate) { Preconditions.checkState(!locked, "Registry is locked against changes"); this.delegate = delegate; }
private Builder check() { Preconditions.checkState(name != null, "Name must be set"); Preconditions.checkState(contentType != null, "contentType must be set"); return this; } }
/** * Sets a delegate registry that will be used to satisfy lookups that cannot * be resolved from the local registry. * * @param delegate delegate registry. */ public void setDelegate(AltRegistry delegate) { Preconditions.checkState(!locked, "Registry is locked against changes"); this.delegate = delegate; }
private Builder check() { Preconditions.checkState(name != null, "Name must be set"); Preconditions.checkState(contentType != null, "contentType must be set"); return this; } }
/** * Dirty this registry. Whoever is modifying this builder must also hold * onto this builder's lock while modifying it, by using a * {@code sychronized(registry) ...} block, or this method will throw * an {@link IllegalStateException}. */ void dirty() { Preconditions.checkState(Thread.holdsLock(this), "Cannot call dirty() without holding the lock on the registry."); cachedSchema = null; }
/** * Dirty this registry. Whoever is modifying this builder must also hold * onto this builder's lock while modifying it, by using a * {@code sychronized(registry) ...} block, or this method will throw * an {@link IllegalStateException}. */ void dirty() { Preconditions.checkState(Thread.holdsLock(this), "Cannot call dirty() without holding the lock on the registry."); cachedSchema = null; }
/** * Dirty this registry. Whoever is modifying this builder must also hold * onto this builder's lock while modifying it, by using a * {@code sychronized(registry) ...} block, or this method will throw * an {@link IllegalStateException}. */ void dirty() { Preconditions.checkState(Thread.holdsLock(this), "Cannot call dirty() without holding the lock on the registry."); cachedSchema = null; }
/** * Returns the element key at the end of the path. * * @throws IllegalStateException if this path is not to an element. */ public ElementKey<?, ?> getSelectedElementKey() { Preconditions.checkState(!steps.isEmpty(), "Must not be an empty path."); Preconditions.checkState(!selectsAttribute, "Must select an element key."); return (ElementKey<?, ?>) steps.get(steps.size() - 1); }
/** * Gets the {@code <batch:interrupted>} tag that describes * what went wrong. * * @return BatchInterrupted object * @deprecated Use {@link #getIBatchInterrupted()} instead. */ @Deprecated public BatchInterrupted getBatchInterrupted() { Preconditions.checkState(interrupted == null || interrupted instanceof BatchInterrupted, "Use getIBatchInterrupted() instead"); return (BatchInterrupted) interrupted; }
/** * Gets the {@code <batch:interrupted>} tag that describes * what went wrong. * * @return BatchInterrupted object * @deprecated Use {@link #getIBatchInterrupted()} instead. */ @Deprecated public BatchInterrupted getBatchInterrupted() { Preconditions.checkState(interrupted == null || interrupted instanceof BatchInterrupted, "Use getIBatchInterrupted() instead"); return (BatchInterrupted) interrupted; }
/** * Returns the element key at the end of the path. * * @throws IllegalStateException if this path is not to an element. */ public ElementKey<?, ?> getSelectedElementKey() { Preconditions.checkState(!steps.isEmpty(), "Must not be an empty path."); Preconditions.checkState(!selectsAttribute, "Must select an element key."); return (ElementKey<?, ?>) steps.get(steps.size() - 1); }
/** * Returns the element key at the end of the path. * * @throws IllegalStateException if this path is not to an element. */ public ElementKey<?, ?> getSelectedElementKey() { Preconditions.checkState(!steps.isEmpty(), "Must not be an empty path."); Preconditions.checkState(!selectsAttribute, "Must select an element key."); return (ElementKey<?, ?>) steps.get(steps.size() - 1); }
/** * Returns the attribute key at the end of the path. * * @throws IllegalStateException if this path is not to an attribute. */ public AttributeKey<?> getSelectedAttributeKey() { Preconditions.checkState(selectsAttribute, "Must select an attribute key."); return (AttributeKey<?>) steps.get(steps.size() - 1); }
/** * Returns the attribute key at the end of the path. * * @throws IllegalStateException if this path is not to an attribute. */ public AttributeKey<?> getSelectedAttributeKey() { Preconditions.checkState(selectsAttribute, "Must select an attribute key."); return (AttributeKey<?>) steps.get(steps.size() - 1); }
/** * Returns the attribute key at the end of the path. * * @throws IllegalStateException if this path is not to an attribute. */ public AttributeKey<?> getSelectedAttributeKey() { Preconditions.checkState(selectsAttribute, "Must select an attribute key."); return (AttributeKey<?>) steps.get(steps.size() - 1); }
/** * Throws an {@link IllegalStateException} if this instance is locked. */ private void throwExceptionIfLocked() { Preconditions.checkState(!state.locked, "%s instance is read only", getElementId()); }
/** * Throws an {@link IllegalStateException} if this instance is locked. */ private void throwExceptionIfLocked() { Preconditions.checkState(!state.locked, "%s instance is read only", getElementId()); }
/** * Throws an {@link IllegalStateException} if this instance is locked. */ private void throwExceptionIfLocked() { Preconditions.checkState(!state.locked, "%s instance is read only", getElementId()); }