diff options
author | Pamela Dragosh <pdragosh@research.att.com> | 2018-03-20 14:49:45 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-03-20 14:49:45 +0000 |
commit | ff1b759ff023dc9a940ab9de4333adcac82b9867 (patch) | |
tree | 039e5ae2835874dbcbdf7ba7981b853242c51655 /common-logging/src/main/java/org/onap/policy/common/logging/nsa/LoggingContextFactory.java | |
parent | 77ad3209e44b4d749cf45d2c5b2bd9e0214e9c9c (diff) | |
parent | 5492c1dd9d7052781ae5cab28bf5bcc829ae9c9e (diff) |
Merge "Removed checkstyle warnings"
Diffstat (limited to 'common-logging/src/main/java/org/onap/policy/common/logging/nsa/LoggingContextFactory.java')
-rw-r--r-- | common-logging/src/main/java/org/onap/policy/common/logging/nsa/LoggingContextFactory.java | 44 |
1 files changed, 19 insertions, 25 deletions
diff --git a/common-logging/src/main/java/org/onap/policy/common/logging/nsa/LoggingContextFactory.java b/common-logging/src/main/java/org/onap/policy/common/logging/nsa/LoggingContextFactory.java index b2ad76ca..85600671 100644 --- a/common-logging/src/main/java/org/onap/policy/common/logging/nsa/LoggingContextFactory.java +++ b/common-logging/src/main/java/org/onap/policy/common/logging/nsa/LoggingContextFactory.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP-Logging * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,37 +20,31 @@ package org.onap.policy.common.logging.nsa; - import org.onap.policy.common.logging.nsa.impl.SharedContext; import org.onap.policy.common.logging.nsa.impl.Slf4jLoggingContext; /** - * A factory for setting up a LoggingContext + * A factory for setting up a LoggingContext. * */ -public class LoggingContextFactory -{ - public static class Builder - { +public class LoggingContextFactory { + public static class Builder { + + private LoggingContext baseContext = null; + private boolean forShared = false; - private LoggingContext fBase = null; - private boolean fShared = false; - - public Builder withBaseContext ( LoggingContext lc ) - { - fBase = lc; - return this; - } + public Builder withBaseContext(LoggingContext lc) { + baseContext = lc; + return this; + } - public Builder forSharing () - { - fShared = true; - return this; - } + public Builder forSharing() { + forShared = true; + return this; + } - public LoggingContext build () - { - return fShared ? new SharedContext ( fBase ) : new Slf4jLoggingContext ( fBase ); - } - } + public LoggingContext build() { + return forShared ? new SharedContext(baseContext) : new Slf4jLoggingContext(baseContext); + } + } } |