/** Constructor with class and key. * @param pcClass the class * @param str the key */ public ShortIdentity (Class pcClass, String str) { super(pcClass); assertKeyNotNull(str); construct(Short.parseShort (str)); }
private void construct(short key) { this.key = key; hashCode = hashClassName() ^ key; }
/** Constructor with class and key. * @param pcClass the class * @param key the key */ public ShortIdentity (Class pcClass, Short key) { super(pcClass); setKeyAsObject(key); construct(key.shortValue()); }
/** Constructor with class and key. * @param pcClass the class * @param key the key */ public ShortIdentity (Class pcClass, short 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. * @param pcClass the class * @param key the key */ public ShortIdentity (Class pcClass, short key) { super(pcClass); construct(key); }
/** Constructor with class and key. * @param pcClass the class * @param key the key */ public ShortIdentity (Class pcClass, Short key) { super(pcClass); setKeyAsObject(key); construct(key.shortValue()); }
/** Constructor with class and key. * @param pcClass the class * @param str the key */ public ShortIdentity (Class pcClass, String str) { super(pcClass); assertKeyNotNull(str); construct(Short.parseShort (str)); }
private void construct(short key) { this.key = key; hashCode = hashClassName() ^ key; }