class ImmutableEntityPlaceholder extends AbstractEntityPlaceholder<NamespacedEntityId> implements EntityPlaceholder {

    @Override
    public Optional<String> resolve(final CharSequence entityId, final String placeholder) {
        argumentNotEmpty(placeholder, "placeholder");
        checkNotNull(entityId, "Entity ID");
        try {
            final NamespacedEntityId namespacedEntityId = DefaultNamespacedEntityId.of(entityId);
            return doResolve(namespacedEntityId, placeholder);
        } catch (final NamespacedEntityIdInvalidException e) {
            // not a namespaced entity ID; does not resolve.
            return Optional.empty();
        }
    }

}