@Test public void testFromTrustEvidenceTypeBean() throws Exception { assertEquals(TrustEvidenceType.SHARED_CONTEXT, TrustModelBeanTranslator.getInstance().fromTrustEvidenceTypeBean(TrustEvidenceTypeBean.SHARED_CONTEXT)); assertEquals(TrustEvidenceType.WITHHELD_CONTEXT, TrustModelBeanTranslator.getInstance().fromTrustEvidenceTypeBean(TrustEvidenceTypeBean.WITHHELD_CONTEXT)); assertEquals(TrustEvidenceType.DIRECTLY_TRUSTED, TrustModelBeanTranslator.getInstance().fromTrustEvidenceTypeBean(TrustEvidenceTypeBean.DIRECTLY_TRUSTED)); assertEquals(TrustEvidenceType.RATED, TrustModelBeanTranslator.getInstance().fromTrustEvidenceTypeBean(TrustEvidenceTypeBean.RATED)); assertEquals(TrustEvidenceType.FRIENDED_USER, TrustModelBeanTranslator.getInstance().fromTrustEvidenceTypeBean(TrustEvidenceTypeBean.FRIENDED_USER)); assertEquals(TrustEvidenceType.UNFRIENDED_USER, TrustModelBeanTranslator.getInstance().fromTrustEvidenceTypeBean(TrustEvidenceTypeBean.UNFRIENDED_USER)); assertEquals(TrustEvidenceType.JOINED_COMMUNITY, TrustModelBeanTranslator.getInstance().fromTrustEvidenceTypeBean(TrustEvidenceTypeBean.JOINED_COMMUNITY)); assertEquals(TrustEvidenceType.LEFT_COMMUNITY, TrustModelBeanTranslator.getInstance().fromTrustEvidenceTypeBean(TrustEvidenceTypeBean.LEFT_COMMUNITY)); assertEquals(TrustEvidenceType.USED_SERVICE, TrustModelBeanTranslator.getInstance().fromTrustEvidenceTypeBean(TrustEvidenceTypeBean.USED_SERVICE)); }
public TrustEvidenceType fromTrustEvidenceTypeBean(TrustEvidenceTypeBean trustEvidenceTypeBean) { if (trustEvidenceTypeBean == null) throw new NullPointerException("trustEvidenceTypeBean can't be null"); switch (trustEvidenceTypeBean) { case SHARED_CONTEXT: return TrustEvidenceType.SHARED_CONTEXT; case WITHHELD_CONTEXT: return TrustEvidenceType.WITHHELD_CONTEXT; case DIRECTLY_TRUSTED: return TrustEvidenceType.DIRECTLY_TRUSTED; case RATED: return TrustEvidenceType.RATED; case FRIENDED_USER: return TrustEvidenceType.FRIENDED_USER; case UNFRIENDED_USER: return TrustEvidenceType.UNFRIENDED_USER; case JOINED_COMMUNITY: return TrustEvidenceType.JOINED_COMMUNITY; case LEFT_COMMUNITY: return TrustEvidenceType.LEFT_COMMUNITY; case INSTALLED_SERVICE: return TrustEvidenceType.INSTALLED_SERVICE; case UNINSTALLED_SERVICE: return TrustEvidenceType.UNINSTALLED_SERVICE; case USED_SERVICE: return TrustEvidenceType.USED_SERVICE; default: throw new IllegalArgumentException("'" + trustEvidenceTypeBean + "': Unsupported trust evidence type bean"); } }
TrustModelBeanTranslator { public TrustEvidenceType fromTrustEvidenceTypeBean(TrustEvidenceTypeBean trustEvidenceTypeBean) { if (trustEvidenceTypeBean == null) throw new NullPointerException("trustEvidenceTypeBean can't be null"); switch (trustEvidenceTypeBean) { case SHARED_CONTEXT: return TrustEvidenceType.SHARED_CONTEXT; case WITHHELD_CONTEXT: return TrustEvidenceType.WITHHELD_CONTEXT; case DIRECTLY_TRUSTED: return TrustEvidenceType.DIRECTLY_TRUSTED; case RATED: return TrustEvidenceType.RATED; case FRIENDED_USER: return TrustEvidenceType.FRIENDED_USER; case UNFRIENDED_USER: return TrustEvidenceType.UNFRIENDED_USER; case JOINED_COMMUNITY: return TrustEvidenceType.JOINED_COMMUNITY; case LEFT_COMMUNITY: return TrustEvidenceType.LEFT_COMMUNITY; case INSTALLED_SERVICE: return TrustEvidenceType.INSTALLED_SERVICE; case UNINSTALLED_SERVICE: return TrustEvidenceType.UNINSTALLED_SERVICE; case USED_SERVICE: return TrustEvidenceType.USED_SERVICE; default: throw new IllegalArgumentException("'" + trustEvidenceTypeBean + "': Unsupported trust evidence type bean"); } } }
TrustModelBeanTranslator { public TrustEvidenceType fromTrustEvidenceTypeBean(TrustEvidenceTypeBean trustEvidenceTypeBean) { if (trustEvidenceTypeBean == null) throw new NullPointerException("trustEvidenceTypeBean can't be null"); switch (trustEvidenceTypeBean) { case SHARED_CONTEXT: return TrustEvidenceType.SHARED_CONTEXT; case WITHHELD_CONTEXT: return TrustEvidenceType.WITHHELD_CONTEXT; case DIRECTLY_TRUSTED: return TrustEvidenceType.DIRECTLY_TRUSTED; case RATED: return TrustEvidenceType.RATED; case FRIENDED_USER: return TrustEvidenceType.FRIENDED_USER; case UNFRIENDED_USER: return TrustEvidenceType.UNFRIENDED_USER; case JOINED_COMMUNITY: return TrustEvidenceType.JOINED_COMMUNITY; case LEFT_COMMUNITY: return TrustEvidenceType.LEFT_COMMUNITY; case INSTALLED_SERVICE: return TrustEvidenceType.INSTALLED_SERVICE; case UNINSTALLED_SERVICE: return TrustEvidenceType.UNINSTALLED_SERVICE; case USED_SERVICE: return TrustEvidenceType.USED_SERVICE; default: throw new IllegalArgumentException("'" + trustEvidenceTypeBean + "': Unsupported trust evidence type bean"); } } private  TrustModelBeanTranslator(); }
TrustModelBeanTranslator { public TrustEvidenceType fromTrustEvidenceTypeBean(TrustEvidenceTypeBean trustEvidenceTypeBean) { if (trustEvidenceTypeBean == null) throw new NullPointerException("trustEvidenceTypeBean can't be null"); switch (trustEvidenceTypeBean) { case SHARED_CONTEXT: return TrustEvidenceType.SHARED_CONTEXT; case WITHHELD_CONTEXT: return TrustEvidenceType.WITHHELD_CONTEXT; case DIRECTLY_TRUSTED: return TrustEvidenceType.DIRECTLY_TRUSTED; case RATED: return TrustEvidenceType.RATED; case FRIENDED_USER: return TrustEvidenceType.FRIENDED_USER; case UNFRIENDED_USER: return TrustEvidenceType.UNFRIENDED_USER; case JOINED_COMMUNITY: return TrustEvidenceType.JOINED_COMMUNITY; case LEFT_COMMUNITY: return TrustEvidenceType.LEFT_COMMUNITY; case INSTALLED_SERVICE: return TrustEvidenceType.INSTALLED_SERVICE; case UNINSTALLED_SERVICE: return TrustEvidenceType.UNINSTALLED_SERVICE; case USED_SERVICE: return TrustEvidenceType.USED_SERVICE; default: throw new IllegalArgumentException("'" + trustEvidenceTypeBean + "': Unsupported trust evidence type bean"); } } private  TrustModelBeanTranslator(); static synchronized TrustModelBeanTranslator getInstance(); TrustedEntityIdBean fromTrustedEntityId(TrustedEntityId teid); TrustedEntityId fromTrustedEntityIdBean(TrustedEntityIdBean teidBean); TrustedEntityTypeBean fromTrustedEntityType(TrustedEntityType trustedEntityType); TrustedEntityType fromTrustedEntityTypeBean(TrustedEntityTypeBean trustedEntityTypeBean); TrustValueTypeBean fromTrustValueType(TrustValueType trustValueType); TrustValueType fromTrustValueTypeBean(TrustValueTypeBean trustValueTypeBean); TrustEvidenceTypeBean fromTrustEvidenceType(TrustEvidenceType trustEvidenceType); TrustEvidenceType fromTrustEvidenceTypeBean(TrustEvidenceTypeBean trustEvidenceTypeBean); TrustRelationshipBean fromTrustRelationship(TrustRelationship trustRelationship); TrustRelationship fromTrustRelationshipBean(TrustRelationshipBean trustRelationshipBean); }
TrustModelBeanTranslator { public TrustEvidenceType fromTrustEvidenceTypeBean(TrustEvidenceTypeBean trustEvidenceTypeBean) { if (trustEvidenceTypeBean == null) throw new NullPointerException("trustEvidenceTypeBean can't be null"); switch (trustEvidenceTypeBean) { case SHARED_CONTEXT: return TrustEvidenceType.SHARED_CONTEXT; case WITHHELD_CONTEXT: return TrustEvidenceType.WITHHELD_CONTEXT; case DIRECTLY_TRUSTED: return TrustEvidenceType.DIRECTLY_TRUSTED; case RATED: return TrustEvidenceType.RATED; case FRIENDED_USER: return TrustEvidenceType.FRIENDED_USER; case UNFRIENDED_USER: return TrustEvidenceType.UNFRIENDED_USER; case JOINED_COMMUNITY: return TrustEvidenceType.JOINED_COMMUNITY; case LEFT_COMMUNITY: return TrustEvidenceType.LEFT_COMMUNITY; case INSTALLED_SERVICE: return TrustEvidenceType.INSTALLED_SERVICE; case UNINSTALLED_SERVICE: return TrustEvidenceType.UNINSTALLED_SERVICE; case USED_SERVICE: return TrustEvidenceType.USED_SERVICE; default: throw new IllegalArgumentException("'" + trustEvidenceTypeBean + "': Unsupported trust evidence type bean"); } } private  TrustModelBeanTranslator(); static synchronized TrustModelBeanTranslator getInstance(); TrustedEntityIdBean fromTrustedEntityId(TrustedEntityId teid); TrustedEntityId fromTrustedEntityIdBean(TrustedEntityIdBean teidBean); TrustedEntityTypeBean fromTrustedEntityType(TrustedEntityType trustedEntityType); TrustedEntityType fromTrustedEntityTypeBean(TrustedEntityTypeBean trustedEntityTypeBean); TrustValueTypeBean fromTrustValueType(TrustValueType trustValueType); TrustValueType fromTrustValueTypeBean(TrustValueTypeBean trustValueTypeBean); TrustEvidenceTypeBean fromTrustEvidenceType(TrustEvidenceType trustEvidenceType); TrustEvidenceType fromTrustEvidenceTypeBean(TrustEvidenceTypeBean trustEvidenceTypeBean); TrustRelationshipBean fromTrustRelationship(TrustRelationship trustRelationship); TrustRelationship fromTrustRelationshipBean(TrustRelationshipBean trustRelationshipBean);  }