/* (non-Javadoc)
@see com.google.code.siren4j.converter.ResourceConverter#toEntity(java.lang.Object)
490516
public Entity toEntity(Object obj) {
        try {
            return toEntity(obj, null, null, null);
        } catch (Siren4JException e) {
            throw new Siren4JConversionException(e);
        }
    }
1371275
private UUID registerObject(final Object object) {
        UUID id = UUID.randomUUID();
        registerObject(object, id);
        return id;
    }
397669
public void setIdentities(java.util.Collection<String> identities) {
        if (identities == null) {
            this.identities = null;
            return;
        }

        this.identities = new com.amazonaws.internal.SdkInternalList<String>(identities);
    }
741532
private void checkForUTOKENNotFoundError(Subject subj) throws ResourceException {

        // A Subject without a UTOKEN genericCredential can
        // legitimately occur in the case where the resource
        // adapter has indicated Thread Identity Support
        // is "ALLOWED, but a valid Container-managed alias
        // was specified. On the other hand, at this ponit, if
        // either of the following two cases exist when there is
        // no UTOKEN genericCredential, then we have an
        // unexpected error and need to throw an exception:
        //
        //   1. The resource adapter REQUIRES that Thread Identity
        //      be used.
        //
        //   2. The Subject has no private credentials at all
        //

        // Check if ThreadIdentitySupport is "REQUIRED"

        if (m_ThreadIdentitySupport == AbstractConnectionFactoryService.THREAD_IDENTITY_REQUIRED) {

            // ThreadIdentitySupport indicates that the use of thread
            // identity is "REQUIRED" by the connector, but the
            // Subject doesn't contain a UTOKEN GenericCredential.
            // This should not ever occur because finalizeSubject()
            // should have created a Subject with a UTOKEN
            // GenericCredential when ThreadidentitySupport is
            // "REQUIRED". Thus, throw an exception to terminate
            // processing right here.
            //

            try {
                IllegalStateException e = new IllegalStateException("ThreadIdentitySecurityHelper.beforeGettingConnection() detected Subject not setup for using thread identity, but the connector requires thread identity be used.");
                Object[] parms = new Object[] { "ThreadIdentitySecurityHelper.beforeGettingConnection()", e };
                Tr.error(tc, "ILLEGAL_STATE_EXCEPTION_J2CA0079", parms);
                throw e;
            } catch (IllegalStateException ise) {
                ResourceException re = new ResourceException("ThreadIdentitySecurityHelper.beforeGettingConnection() detected Subject with illegal state");
                re.initCause(ise);
                throw re;
            }

        } // end if m_ThreadIdentitySupport.equals REQUIRED

        // Check if Subject has at least one a private credential

        Set privateCredentials = subj.getPrivateCredentials();
        Iterator privateIterator = privateCredentials.iterator();

        if (!privateIterator.hasNext()) { // if no private credentials

            // There is not only no UTOKEN generic credential, but
            // also, there are no private credentials at all. This
            // should not happen. If there are no private credentials,
            // the finalizeSubject() processing should have built
            // a UTOKEN generic credential.
            //

            try {
                IllegalStateException e = new IllegalStateException("ThreadIdentitySecurityHelper.beforeGettingConnection() detected Subject with no credentials.");
                Object[] parms = new Object[] { "ThreadIdentitySecurityHelper.beforeGettingConnection()", e };
                Tr.error(tc, "ILLEGAL_STATE_EXCEPTION_J2CA0079", parms);
                throw e;
            } catch (IllegalStateException ise) {
                ResourceException re = new ResourceException("ThreadIdentitySecurityHelper.beforeGettingConnection() detected Subject with illegal state");
                re.initCause(ise);
                throw re;
            }

        } // end if no private credentials
    }
960383
public static <T> Converter<T, T> identity()
	{
		@SuppressWarnings("unchecked")
		Converter<T, T> identity = (Converter<T, T>) IDENTITY;
		
		return identity;
	}
1353355
private static String resolveIdentity(SocketAddress address, IoSessionEx session) {
        if (address instanceof ResourceAddress) {
            Subject subject = session.getSubject();
            if (subject == null) {
                subject = new Subject();
            }
            return resolveIdentity((ResourceAddress) address, subject);
        }
        return null;
    }
1258636
protected IEntity primGetEntity(String key, Class type) throws GroupsException {
        return entityFactory.newInstance(key, type);
    }
1026120
@Override
    public Optional<Identification> getIdentification(String id) {
        return Optional.ofNullable(registered.get(id))
                .map(IdentificationImpl::createIdentification);
    }
1049617
@NonNull
    public ObservableAdapterBuilder<T> identityEquality(@Nullable EqualityFunction<? super T> identityEqualityFunction) {
        mIdentityEqualityFunction = identityEqualityFunction;
        return this;
    }
464426
function isPlainObjectOrEntity(value) {
  return (value instanceof AbstractEntity) || (
        (value instanceof Object) &&
        (
          (Object.getPrototypeOf(value) === Object.prototype) ||
          (Object.getPrototypeOf(value) === null)
        )
      )
}
1100504
@Override
    public IPortletEntity getPortletEntity(
            HttpServletRequest request, String portletEntityIdString) {
        final IPortletEntityId portletEntityId =
                this.parseConsistentPortletEntityId(request, portletEntityIdString);
        return this.getPortletEntity(request, portletEntityId);
    }
347198
static <E> List<E> toEntities(Class<E> entityClass, Entity[] nativeEntities) {
    if (nativeEntities == null || nativeEntities.length == 0) {
      return new ArrayList<>();
    }
    return toEntities(entityClass, Arrays.asList(nativeEntities));
  }
713925
@Override
    public void updatePortletEntity(IPortletEntity portletEntity) {
        portletEntity = this.unwrapEntity(portletEntity);
        this.delegatePortletEntityDao.updatePortletEntity(portletEntity);
    }
1209184
@Override
    @Deprecated
    public java.security.Identity getCallerIdentity()
    {
        EJSDeployedSupport s = EJSContainer.getMethodContext();

        // Method not allowed from ejbTimeout.                           LI2281.07
        if (s != null && s.methodInfo.ivInterface == MethodInterface.TIMED_OBJECT)
        {
            IllegalStateException ise =
                            new IllegalStateException("getCallerIdentity() not " +
                                                      "allowed from ejbTimeout");

            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(tc, "getCallerIdentity: " + ise);

            throw ise;
        }

        EJBSecurityCollaborator<?> securityCollaborator = container.ivSecurityCollaborator;
        if (securityCollaborator == null)
        {
            return null; // d740575
        }

        return getCallerIdentity(securityCollaborator, s);
    }
1352035
public void setValue(Object toEntity, Object newValue) throws IllegalAccessException,
            InvocationTargetException
    {
        Object propertyValue = getter.invoke(toEntity);
        if (propertyValue != null)
            nestedWriter.setValue(propertyValue, newValue);
    }
642500
public int identity()
  {
    if (tc.isEntryEnabled()) Tr.entry(tc, "identity",this);
    if (tc.isEntryEnabled()) Tr.exit(tc, "identity",new Integer(_identity));
    return _identity;
  }
982644
private Element genEntityCommon(final Element root, final ResourceXMLParser.Entity entity) {
        final Element tag = root.addElement(entity.getResourceType());
        tag.addAttribute(COMMON_NAME, entity.getName());
        tag.addAttribute(COMMON_DESCRIPTION, notNull(entity.getProperty(COMMON_DESCRIPTION)));
        tag.addAttribute(COMMON_TAGS, notNull(entity.getProperty(COMMON_TAGS)));
        return tag;
    }