Cleanup and format code
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2015 the original author or authors.
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -34,9 +34,9 @@ public class ConfigurationMetadataGroup implements Serializable {
|
||||
|
||||
private final String id;
|
||||
|
||||
private final Map<String, ConfigurationMetadataSource> sources = new HashMap<String, ConfigurationMetadataSource>();
|
||||
private final Map<String, ConfigurationMetadataSource> sources = new HashMap<>();
|
||||
|
||||
private final Map<String, ConfigurationMetadataProperty> properties = new HashMap<String, ConfigurationMetadataProperty>();
|
||||
private final Map<String, ConfigurationMetadataProperty> properties = new HashMap<>();
|
||||
|
||||
public ConfigurationMetadataGroup(String id) {
|
||||
this.id = id;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -33,9 +33,9 @@ class ConfigurationMetadataHint {
|
||||
|
||||
private String id;
|
||||
|
||||
private final List<ValueHint> valueHints = new ArrayList<ValueHint>();
|
||||
private final List<ValueHint> valueHints = new ArrayList<>();
|
||||
|
||||
private final List<ValueProvider> valueProviders = new ArrayList<ValueProvider>();
|
||||
private final List<ValueProvider> valueProviders = new ArrayList<>();
|
||||
|
||||
public boolean isMapKeyHints() {
|
||||
return (this.id != null && this.id.endsWith(KEY_SUFFIX));
|
||||
|
||||
@@ -41,7 +41,7 @@ public final class ConfigurationMetadataRepositoryJsonBuilder {
|
||||
|
||||
private final JsonReader reader = new JsonReader();
|
||||
|
||||
private final List<SimpleConfigurationMetadataRepository> repositories = new ArrayList<SimpleConfigurationMetadataRepository>();
|
||||
private final List<SimpleConfigurationMetadataRepository> repositories = new ArrayList<>();
|
||||
|
||||
private ConfigurationMetadataRepositoryJsonBuilder(Charset defaultCharset) {
|
||||
this.defaultCharset = defaultCharset;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2015 the original author or authors.
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -42,7 +42,7 @@ public class ConfigurationMetadataSource implements Serializable {
|
||||
|
||||
private String sourceMethod;
|
||||
|
||||
private final Map<String, ConfigurationMetadataProperty> properties = new HashMap<String, ConfigurationMetadataProperty>();
|
||||
private final Map<String, ConfigurationMetadataProperty> properties = new HashMap<>();
|
||||
|
||||
/**
|
||||
* The identifier of the group to which this source is associated.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -29,13 +29,13 @@ import java.util.List;
|
||||
*/
|
||||
public class Hints {
|
||||
|
||||
private final List<ValueHint> keyHints = new ArrayList<ValueHint>();
|
||||
private final List<ValueHint> keyHints = new ArrayList<>();
|
||||
|
||||
private final List<ValueProvider> keyProviders = new ArrayList<ValueProvider>();
|
||||
private final List<ValueProvider> keyProviders = new ArrayList<>();
|
||||
|
||||
private final List<ValueHint> valueHints = new ArrayList<ValueHint>();
|
||||
private final List<ValueHint> valueHints = new ArrayList<>();
|
||||
|
||||
private final List<ValueProvider> valueProviders = new ArrayList<ValueProvider>();
|
||||
private final List<ValueProvider> valueProviders = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* The list of well-defined keys, if any. Only applicable if the type of the related
|
||||
|
||||
@@ -61,7 +61,7 @@ class JsonReader {
|
||||
|
||||
private List<ConfigurationMetadataSource> parseAllSources(JSONObject root)
|
||||
throws Exception {
|
||||
List<ConfigurationMetadataSource> result = new ArrayList<ConfigurationMetadataSource>();
|
||||
List<ConfigurationMetadataSource> result = new ArrayList<>();
|
||||
if (!root.has("groups")) {
|
||||
return result;
|
||||
}
|
||||
@@ -75,7 +75,7 @@ class JsonReader {
|
||||
|
||||
private List<ConfigurationMetadataItem> parseAllItems(JSONObject root)
|
||||
throws Exception {
|
||||
List<ConfigurationMetadataItem> result = new ArrayList<ConfigurationMetadataItem>();
|
||||
List<ConfigurationMetadataItem> result = new ArrayList<>();
|
||||
if (!root.has("properties")) {
|
||||
return result;
|
||||
}
|
||||
@@ -89,7 +89,7 @@ class JsonReader {
|
||||
|
||||
private List<ConfigurationMetadataHint> parseAllHints(JSONObject root)
|
||||
throws Exception {
|
||||
List<ConfigurationMetadataHint> result = new ArrayList<ConfigurationMetadataHint>();
|
||||
List<ConfigurationMetadataHint> result = new ArrayList<>();
|
||||
if (!root.has("hints")) {
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -36,9 +36,9 @@ class RawConfigurationMetadata {
|
||||
RawConfigurationMetadata(List<ConfigurationMetadataSource> sources,
|
||||
List<ConfigurationMetadataItem> items,
|
||||
List<ConfigurationMetadataHint> hints) {
|
||||
this.sources = new ArrayList<ConfigurationMetadataSource>(sources);
|
||||
this.items = new ArrayList<ConfigurationMetadataItem>(items);
|
||||
this.hints = new ArrayList<ConfigurationMetadataHint>(hints);
|
||||
this.sources = new ArrayList<>(sources);
|
||||
this.items = new ArrayList<>(items);
|
||||
this.hints = new ArrayList<>(hints);
|
||||
for (ConfigurationMetadataItem item : this.items) {
|
||||
resolveName(item);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2015 the original author or authors.
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -32,7 +32,7 @@ import java.util.Map;
|
||||
public class SimpleConfigurationMetadataRepository
|
||||
implements ConfigurationMetadataRepository, Serializable {
|
||||
|
||||
private final Map<String, ConfigurationMetadataGroup> allGroups = new HashMap<String, ConfigurationMetadataGroup>();
|
||||
private final Map<String, ConfigurationMetadataGroup> allGroups = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public Map<String, ConfigurationMetadataGroup> getAllGroups() {
|
||||
@@ -41,7 +41,7 @@ public class SimpleConfigurationMetadataRepository
|
||||
|
||||
@Override
|
||||
public Map<String, ConfigurationMetadataProperty> getAllProperties() {
|
||||
Map<String, ConfigurationMetadataProperty> properties = new HashMap<String, ConfigurationMetadataProperty>();
|
||||
Map<String, ConfigurationMetadataProperty> properties = new HashMap<>();
|
||||
for (ConfigurationMetadataGroup group : this.allGroups.values()) {
|
||||
properties.putAll(group.getProperties());
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2015 the original author or authors.
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -35,7 +35,7 @@ public class ValueProvider implements Serializable {
|
||||
|
||||
private String name;
|
||||
|
||||
private final Map<String, Object> parameters = new LinkedHashMap<String, Object>();
|
||||
private final Map<String, Object> parameters = new LinkedHashMap<>();
|
||||
|
||||
/**
|
||||
* Return the name of the provider.
|
||||
|
||||
Reference in New Issue
Block a user