public boolean isDeserializable(final ResolveState newState) { if(newState == null) { throw new ResolveException("new state must be specified"); } if(!(newState == SERIALIZING_TRANSIENT || newState == RESOLVING_PART || newState == RESOLVING || newState == UPDATING)) { throw new ResolveException("state must be one of SERIALIZING_TRANSIENT; RESOLVING_PART; RESOLVING; or UPDATING"); } if (this == TRANSIENT || this == GHOST || this == PART_RESOLVED || this == RESOLVED) { return isValidToChangeTo(newState); } return false; }
/** * Returns true if the state reflects some form of non-resolved state (GHOST, PART_RESOLVED) or is * resolved and it needs to be updated. The specified new state, which you intend to resolve at should be * one of: RESOLVING_PART; RESOLVING; or UPDATING). */ public boolean isResolvable(final ResolveState newState) { if(!(newState == RESOLVING || newState == RESOLVING_PART || newState == UPDATING)) { throw new ResolveException("state must be one of RESOLVING_PART; RESOLVING; or UPDATING"); } if (this == RESOLVED || this == PART_RESOLVED || this == GHOST) { return isValidToChangeTo(newState); } return false; }