Polish
This commit is contained in:
@@ -416,14 +416,13 @@ public class ConfigurationMetadataAnnotationProcessor extends AbstractProcessor
|
||||
if (endpointId == null || "".equals(endpointId)) {
|
||||
return; // Can't process that endpoint
|
||||
}
|
||||
String endpointKey = ItemMetadata.newItemMetadataPrefix(
|
||||
"management.endpoint.", endpointId);
|
||||
String endpointKey = ItemMetadata.newItemMetadataPrefix("management.endpoint.",
|
||||
endpointId);
|
||||
Boolean enabledByDefault = (Boolean) elementValues.get("enableByDefault");
|
||||
String type = this.typeUtils.getQualifiedName(element);
|
||||
this.metadataCollector
|
||||
.add(ItemMetadata.newGroup(endpointKey, type, type, null));
|
||||
this.metadataCollector.add(ItemMetadata.newProperty(endpointKey,
|
||||
"enabled", Boolean.class.getName(), type, null,
|
||||
this.metadataCollector.add(ItemMetadata.newGroup(endpointKey, type, type, null));
|
||||
this.metadataCollector.add(ItemMetadata.newProperty(endpointKey, "enabled",
|
||||
Boolean.class.getName(), type, null,
|
||||
String.format("Whether to enable the %s endpoint.", endpointId),
|
||||
(enabledByDefault == null ? true : enabledByDefault), null));
|
||||
this.metadataCollector.add(ItemMetadata.newProperty(endpointKey,
|
||||
|
||||
@@ -218,8 +218,8 @@ public final class ItemMetadata implements Comparable<ItemMetadata> {
|
||||
}
|
||||
|
||||
public static String newItemMetadataPrefix(String prefix, String suffix) {
|
||||
return prefix.toLowerCase(Locale.ENGLISH) +
|
||||
ConfigurationMetadata.toDashedCase(suffix);
|
||||
return prefix.toLowerCase(Locale.ENGLISH)
|
||||
+ ConfigurationMetadata.toDashedCase(suffix);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -636,9 +636,10 @@ public class ConfigurationMetadataAnnotationProcessorTests {
|
||||
|
||||
private Metadata.MetadataItemCondition enabledFlag(String endpointId,
|
||||
String endpointSuffix, Boolean defaultValue) {
|
||||
return Metadata.withEnabledFlag("management.endpoint." + endpointSuffix
|
||||
+ ".enabled").withDefaultValue(defaultValue).withDescription(
|
||||
String.format("Whether to enable the %s endpoint.", endpointId));
|
||||
return Metadata
|
||||
.withEnabledFlag("management.endpoint." + endpointSuffix + ".enabled")
|
||||
.withDefaultValue(defaultValue).withDescription(
|
||||
String.format("Whether to enable the %s endpoint.", endpointId));
|
||||
}
|
||||
|
||||
private Metadata.MetadataItemCondition enabledFlag(String endpointId,
|
||||
|
||||
Reference in New Issue
Block a user