private static void addKeyString(Query query, Result result, StringBuilder sb) { String keyStr = getValueKey(result); sb.append(StringUtils.cleanupStr(keyStr, query.isAllowDottedKeys())); }
private static void addTypeName(Query query, Result result, List<String> typeNames, StringBuilder sb) { String typeName = StringUtils.cleanupStr(query.makeTypeNameValueString(typeNames, result.getTypeName()), query.isAllowDottedKeys()); if (typeName != null && typeName.length() > 0) { sb.append(typeName); sb.append("."); } }
private TypeNameValuesStringBuilder makeTypeNameValuesStringBuilder() { String separator = isAllowDottedKeys() ? "." : TypeNameValuesStringBuilder.DEFAULT_SEPARATOR; Set<String> typeNames = getTypeNames(); if (isUseAllTypeNames()) { return new UseAllTypeNameValuesStringBuilder(separator); } else if (typeNames != null && !typeNames.isEmpty()) { return new PrependingTypeNameValuesStringBuilder(separator, new ArrayList<>(typeNames)); } else { return new TypeNameValuesStringBuilder(separator); } }
/** * Adds a key to the StringBuilder * * It uses in order of preference: * * 1. resultAlias if that was specified as part of the query * 2. The domain portion of the ObjectName in the query if useObjDomainAsKey is set to true * 3. else, the Class Name of the MBean. I.e. ClassName will be used by default if the * user doesn't specify anything special * @param query * @param result * @param sb */ private static void addMBeanIdentifier(Query query, Result result, StringBuilder sb) { if (result.getKeyAlias() != null) { sb.append(result.getKeyAlias()); } else if (query.isUseObjDomainAsKey()) { sb.append(StringUtils.cleanupStr(result.getObjDomain(), query.isAllowDottedKeys())); } else { sb.append(StringUtils.cleanupStr(result.getClassName())); } }
private static void addKeyString(Query query, Result result, StringBuilder sb) { String keyStr = getValueKey(result); sb.append(StringUtils.cleanupStr(keyStr, query.isAllowDottedKeys())); }
private static void addTypeName(Query query, Result result, List<String> typeNames, StringBuilder sb) { String typeName = StringUtils.cleanupStr(query.makeTypeNameValueString(typeNames, result.getTypeName()), query.isAllowDottedKeys()); if (typeName != null && typeName.length() > 0) { sb.append(typeName); sb.append("."); } }
private TypeNameValuesStringBuilder makeTypeNameValuesStringBuilder() { String separator = isAllowDottedKeys() ? "." : TypeNameValuesStringBuilder.DEFAULT_SEPARATOR; Set<String> typeNames = getTypeNames(); if (isUseAllTypeNames()) { return new UseAllTypeNameValuesStringBuilder(separator); } else if (typeNames != null && !typeNames.isEmpty()) { return new PrependingTypeNameValuesStringBuilder(separator, new ArrayList<>(typeNames)); } else { return new TypeNameValuesStringBuilder(separator); } }
/** * Adds a key to the StringBuilder * * It uses in order of preference: * * 1. resultAlias if that was specified as part of the query * 2. The domain portion of the ObjectName in the query if useObjDomainAsKey is set to true * 3. else, the Class Name of the MBean. I.e. ClassName will be used by default if the * user doesn't specify anything special * @param query * @param result * @param sb */ private static void addMBeanIdentifier(Query query, Result result, StringBuilder sb) { if (result.getKeyAlias() != null) { sb.append(result.getKeyAlias()); } else if (query.isUseObjDomainAsKey()) { sb.append(StringUtils.cleanupStr(result.getObjDomain(), query.isAllowDottedKeys())); } else { sb.append(StringUtils.cleanupStr(result.getClassName())); } }