SerializableContextualHolder(String contextId, C contextual, ContextualStore contextualStore, BeanIdentifierIndex beanIdentifierIndex) { this.contextId = contextId; this.cachedContextualStore = contextualStore; if (contextual instanceof Serializable) { // the contextual is serializable, so we can just use it this.serializable = contextual; this.identifier = null; this.identifierIndex = null; } else { this.serializable = null; BeanIdentifier beanIdentifier = getId(contextual, contextualStore); // The index may be null or not built yet Integer idx = null; if (beanIdentifierIndex != null && beanIdentifierIndex.isBuilt()) { idx = beanIdentifierIndex.getIndex(beanIdentifier); } if (idx != null) { this.identifierIndex = idx; this.identifier = null; } else { this.identifierIndex = null; this.identifier = beanIdentifier; } } // cache the contextual this.cached = contextual; }
SerializableContextualHolder(String contextId, C contextual, ContextualStore contextualStore, BeanIdentifierIndex beanIdentifierIndex) { this.contextId = contextId; this.cachedContextualStore = contextualStore; if (contextual instanceof Serializable) { // the contextual is serializable, so we can just use it this.serializable = contextual; this.identifier = null; this.identifierIndex = null; } else { this.serializable = null; BeanIdentifier beanIdentifier = getId(contextual, contextualStore); // The index may be null or not built yet Integer idx = null; if (beanIdentifierIndex != null && beanIdentifierIndex.isBuilt()) { idx = beanIdentifierIndex.getIndex(beanIdentifier); } if (idx != null) { this.identifierIndex = idx; this.identifier = null; } else { this.identifierIndex = null; this.identifier = beanIdentifier; } } // cache the contextual this.cached = contextual; }
SerializableContextualHolder(String contextId, C contextual, ContextualStore contextualStore, BeanIdentifierIndex beanIdentifierIndex) { this.contextId = contextId; this.cachedContextualStore = contextualStore; if (contextual instanceof Serializable) { // the contextual is serializable, so we can just use it this.serializable = contextual; this.identifier = null; this.identifierIndex = null; } else { this.serializable = null; BeanIdentifier beanIdentifier = getId(contextual, contextualStore); // The index may be null or not built yet Integer idx = null; if (beanIdentifierIndex != null && beanIdentifierIndex.isBuilt()) { idx = beanIdentifierIndex.getIndex(beanIdentifier); } if (idx != null) { this.identifierIndex = idx; this.identifier = null; } else { this.identifierIndex = null; this.identifier = beanIdentifier; } } // cache the contextual this.cached = contextual; }
SerializableContextualHolder(String contextId, C contextual, ContextualStore contextualStore, BeanIdentifierIndex beanIdentifierIndex) { this.contextId = contextId; this.cachedContextualStore = contextualStore; if (contextual instanceof Serializable) { // the contextual is serializable, so we can just use it this.serializable = contextual; this.identifier = null; this.identifierIndex = null; } else { this.serializable = null; BeanIdentifier beanIdentifier = getId(contextual, contextualStore); // The index may be null or not built yet Integer idx = null; if (beanIdentifierIndex != null && beanIdentifierIndex.isBuilt()) { idx = beanIdentifierIndex.getIndex(beanIdentifier); } if (idx != null) { this.identifierIndex = idx; this.identifier = null; } else { this.identifierIndex = null; this.identifier = beanIdentifier; } } // cache the contextual this.cached = contextual; }
SerializableContextualHolder(String contextId, C contextual, ContextualStore contextualStore, BeanIdentifierIndex beanIdentifierIndex) { this.contextId = contextId; this.cachedContextualStore = contextualStore; if (contextual instanceof Serializable) { // the contextual is serializable, so we can just use it this.serializable = contextual; this.identifier = null; this.identifierIndex = null; } else { this.serializable = null; BeanIdentifier beanIdentifier = getId(contextual, contextualStore); // The index may be null or not built yet Integer idx = null; if (beanIdentifierIndex != null && beanIdentifierIndex.isBuilt()) { idx = beanIdentifierIndex.getIndex(beanIdentifier); } if (idx != null) { this.identifierIndex = idx; this.identifier = null; } else { this.identifierIndex = null; this.identifier = beanIdentifier; } } // cache the contextual this.cached = contextual; }
SerializableContextualHolder(String contextId, C contextual, ContextualStore contextualStore, BeanIdentifierIndex beanIdentifierIndex) { this.contextId = contextId; this.cachedContextualStore = contextualStore; if (contextual instanceof Serializable) { // the contextual is serializable, so we can just use it this.serializable = contextual; this.identifier = null; this.identifierIndex = null; } else { this.serializable = null; BeanIdentifier beanIdentifier = getId(contextual, contextualStore); // The index may be null or not built yet Integer idx = null; if (beanIdentifierIndex != null && beanIdentifierIndex.isBuilt()) { idx = beanIdentifierIndex.getIndex(beanIdentifier); } if (idx != null) { this.identifierIndex = idx; this.identifier = null; } else { this.identifierIndex = null; this.identifier = beanIdentifier; } } // cache the contextual this.cached = contextual; }
@Override public String prefix(BeanIdentifier id) { if (index == null) { return getPrefix() + getDelimiter() + id.asString(); } Integer idx = index.getIndex(id); if (idx == null) { return getPrefix() + getDelimiter() + FALLBACK_FLAG + id.asString(); } return getPrefix() + getDelimiter() + idx; }
@Override public String prefix(BeanIdentifier id) { if (index == null) { return getPrefix() + getDelimiter() + id.asString(); } Integer idx = index.getIndex(id); if (idx == null) { return getPrefix() + getDelimiter() + FALLBACK_FLAG + id.asString(); } return getPrefix() + getDelimiter() + idx; }
@Override public String prefix(BeanIdentifier id) { if (index == null) { return getPrefix() + getDelimiter() + id.asString(); } Integer idx = index.getIndex(id); if (idx == null) { return getPrefix() + getDelimiter() + FALLBACK_FLAG + id.asString(); } return getPrefix() + getDelimiter() + idx; }
@Override public String prefix(BeanIdentifier id) { if (index == null) { return getPrefix() + getDelimiter() + id.asString(); } Integer idx = index.getIndex(id); if (idx == null) { return getPrefix() + getDelimiter() + FALLBACK_FLAG + id.asString(); } return getPrefix() + getDelimiter() + idx; }
@Override public String prefix(BeanIdentifier id) { if (index == null) { return getPrefix() + getDelimiter() + id.asString(); } Integer idx = index.getIndex(id); if (idx == null) { return getPrefix() + getDelimiter() + FALLBACK_FLAG + id.asString(); } return getPrefix() + getDelimiter() + idx; }
@Override public String prefix(BeanIdentifier id) { if (index == null) { return getPrefix() + getDelimiter() + id.asString(); } Integer idx = index.getIndex(id); if (idx == null) { return getPrefix() + getDelimiter() + FALLBACK_FLAG + id.asString(); } return getPrefix() + getDelimiter() + idx; }