Checkstyle: DeclarationOrder, 'enterpriseNumber' hides field, IDE autoformatted
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/111ea364 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/111ea364 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/111ea364 Branch: refs/heads/master Commit: 111ea364e0dab3726de23c4a9c469dc3430b5b40 Parents: ac42b6a Author: rpopma <[email protected]> Authored: Thu Sep 24 09:10:46 2015 +0200 Committer: rpopma <[email protected]> Committed: Thu Sep 24 09:10:46 2015 +0200 ---------------------------------------------------------------------- .../logging/log4j/message/StructuredDataId.java | 39 +++++++++++--------- 1 file changed, 22 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/111ea364/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataId.java ---------------------------------------------------------------------- diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataId.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataId.java index 606d16e..2bbb9a2 100644 --- a/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataId.java +++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataId.java @@ -25,25 +25,23 @@ import org.apache.logging.log4j.util.Strings; */ public class StructuredDataId implements Serializable { - private static final String AT_SIGN = "@"; - /** * RFC 5424 Time Quality. */ - public static final StructuredDataId TIME_QUALITY = new StructuredDataId("timeQuality", null, - new String[]{"tzKnown", "isSynced", "syncAccuracy"}); + public static final StructuredDataId TIME_QUALITY = new StructuredDataId("timeQuality", null, new String[] { + "tzKnown", "isSynced", "syncAccuracy" }); /** * RFC 5424 Origin. */ - public static final StructuredDataId ORIGIN = new StructuredDataId("origin", null, - new String[]{"ip", "enterpriseId", "software", "swVersion"}); + public static final StructuredDataId ORIGIN = new StructuredDataId("origin", null, new String[] { "ip", + "enterpriseId", "software", "swVersion" }); /** * RFC 5424 Meta. */ - public static final StructuredDataId META = new StructuredDataId("meta", null, - new String[]{"sequenceId", "sysUpTime", "language"}); + public static final StructuredDataId META = new StructuredDataId("meta", null, new String[] { "sequenceId", + "sysUpTime", "language" }); /** * Reserved enterprise number. @@ -52,13 +50,13 @@ public class StructuredDataId implements Serializable { private static final long serialVersionUID = 9031746276396249990L; private static final int MAX_LENGTH = 32; + private static final String AT_SIGN = "@"; private final String name; private final int enterpriseNumber; private final String[] required; private final String[] optional; - protected StructuredDataId(final String name, final String[] required, final String[] optional) { int index = -1; if (name != null) { @@ -83,13 +81,13 @@ public class StructuredDataId implements Serializable { /** * A Constructor that helps conformance to RFC 5424. * - * @param name The name portion of the id. + * @param name The name portion of the id. * @param enterpriseNumber The enterprise number. - * @param required The list of keys that are required for this id. - * @param optional The list of keys that are optional for this id. + * @param required The list of keys that are required for this id. + * @param optional The list of keys that are optional for this id. */ public StructuredDataId(final String name, final int enterpriseNumber, final String[] required, - final String[] optional) { + final String[] optional) { if (name == null) { throw new IllegalArgumentException("No structured id name was supplied"); } @@ -111,6 +109,7 @@ public class StructuredDataId implements Serializable { /** * Creates an id using another id to supply default values. + * * @param id The original StructuredDataId. * @return the new StructuredDataId. */ @@ -123,15 +122,16 @@ public class StructuredDataId implements Serializable { /** * Creates an id based on the current id. + * * @param defaultId The default id to use if this StructuredDataId doesn't have a name. - * @param enterpriseNumber The enterprise number. + * @param anEnterpriseNumber The enterprise number. * @return a StructuredDataId. */ - public StructuredDataId makeId(final String defaultId, final int enterpriseNumber) { + public StructuredDataId makeId(final String defaultId, final int anEnterpriseNumber) { String id; String[] req; String[] opt; - if (enterpriseNumber <= 0) { + if (anEnterpriseNumber <= 0) { return this; } if (this.name != null) { @@ -144,11 +144,12 @@ public class StructuredDataId implements Serializable { opt = null; } - return new StructuredDataId(id, enterpriseNumber, req, opt); + return new StructuredDataId(id, anEnterpriseNumber, req, opt); } /** * Returns a list of required keys. + * * @return a List of required keys or null if none have been provided. */ public String[] getRequired() { @@ -157,6 +158,7 @@ public class StructuredDataId implements Serializable { /** * Returns a list of optional keys. + * * @return a List of optional keys or null if none have been provided. */ public String[] getOptional() { @@ -165,6 +167,7 @@ public class StructuredDataId implements Serializable { /** * Returns the StructuredDataId name. + * * @return the StructuredDataId name. */ public String getName() { @@ -173,6 +176,7 @@ public class StructuredDataId implements Serializable { /** * Returns the enterprise number. + * * @return the enterprise number. */ public int getEnterpriseNumber() { @@ -181,6 +185,7 @@ public class StructuredDataId implements Serializable { /** * Indicates if the id is reserved. + * * @return true if the id uses the reserved enterprise number, false otherwise. */ public boolean isReserved() {
