@Test public void testFromTrustEvidenceType() throws Exception { assertEquals(TrustEvidenceTypeBean.SHARED_CONTEXT, TrustModelBeanTranslator.getInstance().fromTrustEvidenceType(TrustEvidenceType.SHARED_CONTEXT)); assertEquals(TrustEvidenceTypeBean.WITHHELD_CONTEXT, TrustModelBeanTranslator.getInstance().fromTrustEvidenceType(TrustEvidenceType.WITHHELD_CONTEXT)); assertEquals(TrustEvidenceTypeBean.DIRECTLY_TRUSTED, TrustModelBeanTranslator.getInstance().fromTrustEvidenceType(TrustEvidenceType.DIRECTLY_TRUSTED)); assertEquals(TrustEvidenceTypeBean.RATED, TrustModelBeanTranslator.getInstance().fromTrustEvidenceType(TrustEvidenceType.RATED)); assertEquals(TrustEvidenceTypeBean.FRIENDED_USER, TrustModelBeanTranslator.getInstance().fromTrustEvidenceType(TrustEvidenceType.FRIENDED_USER)); assertEquals(TrustEvidenceTypeBean.UNFRIENDED_USER, TrustModelBeanTranslator.getInstance().fromTrustEvidenceType(TrustEvidenceType.UNFRIENDED_USER)); assertEquals(TrustEvidenceTypeBean.JOINED_COMMUNITY, TrustModelBeanTranslator.getInstance().fromTrustEvidenceType(TrustEvidenceType.JOINED_COMMUNITY)); assertEquals(TrustEvidenceTypeBean.LEFT_COMMUNITY, TrustModelBeanTranslator.getInstance().fromTrustEvidenceType(TrustEvidenceType.LEFT_COMMUNITY)); assertEquals(TrustEvidenceTypeBean.USED_SERVICE, TrustModelBeanTranslator.getInstance().fromTrustEvidenceType(TrustEvidenceType.USED_SERVICE)); }
public TrustEvidenceTypeBean fromTrustEvidenceType(TrustEvidenceType trustEvidenceType) { if (trustEvidenceType == null) throw new NullPointerException("trustEvidenceType can't be null"); switch (trustEvidenceType) { case SHARED_CONTEXT: return TrustEvidenceTypeBean.SHARED_CONTEXT; case WITHHELD_CONTEXT: return TrustEvidenceTypeBean.WITHHELD_CONTEXT; case DIRECTLY_TRUSTED: return TrustEvidenceTypeBean.DIRECTLY_TRUSTED; case RATED: return TrustEvidenceTypeBean.RATED; case FRIENDED_USER: return TrustEvidenceTypeBean.FRIENDED_USER; case UNFRIENDED_USER: return TrustEvidenceTypeBean.UNFRIENDED_USER; case JOINED_COMMUNITY: return TrustEvidenceTypeBean.JOINED_COMMUNITY; case LEFT_COMMUNITY: return TrustEvidenceTypeBean.LEFT_COMMUNITY; case INSTALLED_SERVICE: return TrustEvidenceTypeBean.INSTALLED_SERVICE; case UNINSTALLED_SERVICE: return TrustEvidenceTypeBean.UNINSTALLED_SERVICE; case USED_SERVICE: return TrustEvidenceTypeBean.USED_SERVICE; default: throw new IllegalArgumentException("'" + trustEvidenceType + "': Unsupported trust evidence type"); } }
TrustModelBeanTranslator { public TrustEvidenceTypeBean fromTrustEvidenceType(TrustEvidenceType trustEvidenceType) { if (trustEvidenceType == null) throw new NullPointerException("trustEvidenceType can't be null"); switch (trustEvidenceType) { case SHARED_CONTEXT: return TrustEvidenceTypeBean.SHARED_CONTEXT; case WITHHELD_CONTEXT: return TrustEvidenceTypeBean.WITHHELD_CONTEXT; case DIRECTLY_TRUSTED: return TrustEvidenceTypeBean.DIRECTLY_TRUSTED; case RATED: return TrustEvidenceTypeBean.RATED; case FRIENDED_USER: return TrustEvidenceTypeBean.FRIENDED_USER; case UNFRIENDED_USER: return TrustEvidenceTypeBean.UNFRIENDED_USER; case JOINED_COMMUNITY: return TrustEvidenceTypeBean.JOINED_COMMUNITY; case LEFT_COMMUNITY: return TrustEvidenceTypeBean.LEFT_COMMUNITY; case INSTALLED_SERVICE: return TrustEvidenceTypeBean.INSTALLED_SERVICE; case UNINSTALLED_SERVICE: return TrustEvidenceTypeBean.UNINSTALLED_SERVICE; case USED_SERVICE: return TrustEvidenceTypeBean.USED_SERVICE; default: throw new IllegalArgumentException("'" + trustEvidenceType + "': Unsupported trust evidence type"); } } }
TrustModelBeanTranslator { public TrustEvidenceTypeBean fromTrustEvidenceType(TrustEvidenceType trustEvidenceType) { if (trustEvidenceType == null) throw new NullPointerException("trustEvidenceType can't be null"); switch (trustEvidenceType) { case SHARED_CONTEXT: return TrustEvidenceTypeBean.SHARED_CONTEXT; case WITHHELD_CONTEXT: return TrustEvidenceTypeBean.WITHHELD_CONTEXT; case DIRECTLY_TRUSTED: return TrustEvidenceTypeBean.DIRECTLY_TRUSTED; case RATED: return TrustEvidenceTypeBean.RATED; case FRIENDED_USER: return TrustEvidenceTypeBean.FRIENDED_USER; case UNFRIENDED_USER: return TrustEvidenceTypeBean.UNFRIENDED_USER; case JOINED_COMMUNITY: return TrustEvidenceTypeBean.JOINED_COMMUNITY; case LEFT_COMMUNITY: return TrustEvidenceTypeBean.LEFT_COMMUNITY; case INSTALLED_SERVICE: return TrustEvidenceTypeBean.INSTALLED_SERVICE; case UNINSTALLED_SERVICE: return TrustEvidenceTypeBean.UNINSTALLED_SERVICE; case USED_SERVICE: return TrustEvidenceTypeBean.USED_SERVICE; default: throw new IllegalArgumentException("'" + trustEvidenceType + "': Unsupported trust evidence type"); } } private  TrustModelBeanTranslator(); }
TrustModelBeanTranslator { public TrustEvidenceTypeBean fromTrustEvidenceType(TrustEvidenceType trustEvidenceType) { if (trustEvidenceType == null) throw new NullPointerException("trustEvidenceType can't be null"); switch (trustEvidenceType) { case SHARED_CONTEXT: return TrustEvidenceTypeBean.SHARED_CONTEXT; case WITHHELD_CONTEXT: return TrustEvidenceTypeBean.WITHHELD_CONTEXT; case DIRECTLY_TRUSTED: return TrustEvidenceTypeBean.DIRECTLY_TRUSTED; case RATED: return TrustEvidenceTypeBean.RATED; case FRIENDED_USER: return TrustEvidenceTypeBean.FRIENDED_USER; case UNFRIENDED_USER: return TrustEvidenceTypeBean.UNFRIENDED_USER; case JOINED_COMMUNITY: return TrustEvidenceTypeBean.JOINED_COMMUNITY; case LEFT_COMMUNITY: return TrustEvidenceTypeBean.LEFT_COMMUNITY; case INSTALLED_SERVICE: return TrustEvidenceTypeBean.INSTALLED_SERVICE; case UNINSTALLED_SERVICE: return TrustEvidenceTypeBean.UNINSTALLED_SERVICE; case USED_SERVICE: return TrustEvidenceTypeBean.USED_SERVICE; default: throw new IllegalArgumentException("'" + trustEvidenceType + "': Unsupported trust evidence type"); } } 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 TrustEvidenceTypeBean fromTrustEvidenceType(TrustEvidenceType trustEvidenceType) { if (trustEvidenceType == null) throw new NullPointerException("trustEvidenceType can't be null"); switch (trustEvidenceType) { case SHARED_CONTEXT: return TrustEvidenceTypeBean.SHARED_CONTEXT; case WITHHELD_CONTEXT: return TrustEvidenceTypeBean.WITHHELD_CONTEXT; case DIRECTLY_TRUSTED: return TrustEvidenceTypeBean.DIRECTLY_TRUSTED; case RATED: return TrustEvidenceTypeBean.RATED; case FRIENDED_USER: return TrustEvidenceTypeBean.FRIENDED_USER; case UNFRIENDED_USER: return TrustEvidenceTypeBean.UNFRIENDED_USER; case JOINED_COMMUNITY: return TrustEvidenceTypeBean.JOINED_COMMUNITY; case LEFT_COMMUNITY: return TrustEvidenceTypeBean.LEFT_COMMUNITY; case INSTALLED_SERVICE: return TrustEvidenceTypeBean.INSTALLED_SERVICE; case UNINSTALLED_SERVICE: return TrustEvidenceTypeBean.UNINSTALLED_SERVICE; case USED_SERVICE: return TrustEvidenceTypeBean.USED_SERVICE; default: throw new IllegalArgumentException("'" + trustEvidenceType + "': Unsupported trust evidence type"); } } 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);  }