private static boolean startsWithKeyConstant(String attributeName) { return attributeName.startsWith(KEY_ATTRIBUTE_NAME.value()); }
private static boolean startsWithKeyConstant(String attributeName) { return attributeName.startsWith(KEY_ATTRIBUTE_NAME.value()); }
private static String getAttributeName(boolean isKey, String attributeName) { if (isKey) { return attributeName.substring(KEY_ATTRIBUTE_NAME.value().length() + 1); } else { return attributeName; } }
private static String getAttributeName(boolean isKey, String attributeName) { if (isKey) { return attributeName.substring(KEY_ATTRIBUTE_NAME.value().length() + 1); } else { return attributeName; } }
/** * Optimized version of the other extractAttributeValueIfAttributeQueryConstant() method that uses getKey() and * getValue() calls that may cache their results internally - like in CachedQueryEntry. */ private Object extractAttributeValueIfAttributeQueryConstant(String attributeName) { if (KEY_ATTRIBUTE_NAME.value().equals(attributeName)) { return getKey(); } else if (THIS_ATTRIBUTE_NAME.value().equals(attributeName)) { return getValue(); } return null; }
/** * Static version of the extractAttributeValueIfAttributeQueryConstant() method that needs key and value upfront. */ private static Object extractAttributeValueIfAttributeQueryConstant(InternalSerializationService serializationService, String attributeName, Data key, Object value) { if (KEY_ATTRIBUTE_NAME.value().equals(attributeName)) { return serializationService.toObject(key); } else if (THIS_ATTRIBUTE_NAME.value().equals(attributeName)) { return value instanceof Data ? serializationService.toObject(value) : value; } return null; }
/** * Optimized version of the other extractAttributeValueIfAttributeQueryConstant() method that uses getKey() and * getValue() calls that may cache their results internally - like in CachedQueryEntry. */ private Object extractAttributeValueIfAttributeQueryConstant(String attributeName) { if (KEY_ATTRIBUTE_NAME.value().equals(attributeName)) { return getKey(); } else if (THIS_ATTRIBUTE_NAME.value().equals(attributeName)) { return getValue(); } return null; }
/** * Static version of the extractAttributeValueIfAttributeQueryConstant() method that needs key and value upfront. */ private static Object extractAttributeValueIfAttributeQueryConstant(InternalSerializationService serializationService, String attributeName, Data key, Object value) { if (KEY_ATTRIBUTE_NAME.value().equals(attributeName)) { return serializationService.toObject(key); } else if (THIS_ATTRIBUTE_NAME.value().equals(attributeName)) { return value instanceof Data ? serializationService.toObject(value) : value; } return null; }
public EntryObject key() { qb.setAttribute(KEY_ATTRIBUTE_NAME.value()); return this; }
public EntryObject key() { qb.setAttribute(KEY_ATTRIBUTE_NAME.value()); return this; }
/** * Validates index attribute content. * * @param attribute attribute to validate * @return the attribute for fluent assignment */ public static String validateIndexAttribute(String attribute) { checkHasText(attribute, "Map index attribute must contain text"); String keyPrefix = KEY_ATTRIBUTE_NAME.value(); if (attribute.startsWith(keyPrefix) && attribute.length() > keyPrefix.length()) { if (attribute.charAt(keyPrefix.length()) != '#') { LOG.warning(KEY_ATTRIBUTE_NAME.value() + " used without a following '#' char in index attribute '" + attribute + "'. Don't you want to index a key?"); } } return attribute; }
/** * Validates index attribute content. * * @param attribute attribute to validate * @return the attribute for fluent assignment */ public static String validateIndexAttribute(String attribute) { checkHasText(attribute, "Map index attribute must contain text"); String keyPrefix = KEY_ATTRIBUTE_NAME.value(); if (attribute.startsWith(keyPrefix) && attribute.length() > keyPrefix.length()) { if (attribute.charAt(keyPrefix.length()) != '#') { LOG.warning(KEY_ATTRIBUTE_NAME.value() + " used without a following '#' char in index attribute '" + attribute + "'. Don't you want to index a key?"); } } return attribute; }
private AttributeType extractAttributeTypeIfAttributeQueryConstant(String attributeName) { if (KEY_ATTRIBUTE_NAME.value().equals(attributeName)) { return ReflectionHelper.getAttributeType(getKey().getClass()); } else if (THIS_ATTRIBUTE_NAME.value().equals(attributeName)) { return ReflectionHelper.getAttributeType(getValue().getClass()); } return null; }
possibleMethodNames.add("get" + camelName); possibleMethodNames.add("is" + camelName); if (baseName.equals(THIS_ATTRIBUTE_NAME.value())) { localGetter = GetterFactory.newThisGetter(parent, obj); } else {
possibleMethodNames.add("get" + camelName); possibleMethodNames.add("is" + camelName); if (baseName.equals(THIS_ATTRIBUTE_NAME.value())) { localGetter = GetterFactory.newThisGetter(parent, obj); } else {