/** Constructor with class and key. * @param pcClass the target class * @param key the key */ public CharIdentity (Class pcClass, Character key) { super (pcClass); setKeyAsObject(key); construct(key.charValue()); }
private void construct(char key) { this.key = key; hashCode = hashClassName() ^ key; }
/** Constructor with class and key. The String must have exactly one * character. * @param pcClass the target class * @param str the key */ public CharIdentity (Class pcClass, String str) { super(pcClass); assertKeyNotNull(str); if (str.length() != 1) throw new IllegalArgumentException( msg.msg("EXC_StringWrongLength")); //NOI18N construct(str.charAt(0)); }
/** Constructor with class and key. * @param pcClass the target class * @param key the key */ public CharIdentity (Class pcClass, char key) { super (pcClass); construct(key); }
public static SingleFieldIdentity getSingleFieldIdentityForDataNucleusIdentity(SingleFieldId dnid, Class targetClass) { if (dnid instanceof LongId) { return new LongIdentity(targetClass, dnid.toString()); } else if (dnid instanceof IntId) { return new IntIdentity(targetClass, dnid.toString()); } else if (dnid instanceof ShortId) { return new ShortIdentity(targetClass, dnid.toString()); } else if (dnid instanceof ByteId) { return new ByteIdentity(targetClass, dnid.toString()); } else if (dnid instanceof StringId) { return new StringIdentity(targetClass, dnid.toString()); } else if (dnid instanceof CharId) { return new CharIdentity(targetClass, dnid.toString()); } return new ObjectIdentity(targetClass, dnid.getKeyAsObject()); }
/** Constructor with class and key. The String must have exactly one * character. * @param pcClass the target class * @param str the key */ public CharIdentity (Class pcClass, String str) { super(pcClass); assertKeyNotNull(str); if (str.length() != 1) throw new IllegalArgumentException( msg.msg("EXC_StringWrongLength")); //NOI18N construct(str.charAt(0)); }
/** Constructor with class and key. * @param pcClass the target class * @param key the key */ public CharIdentity (Class pcClass, char key) { super (pcClass); construct(key); }
/** Constructor with class and key. * @param pcClass the target class * @param key the key */ public CharIdentity (Class pcClass, Character key) { super (pcClass); setKeyAsObject(key); construct(key.charValue()); }
private void construct(char key) { this.key = key; hashCode = hashClassName() ^ key; }