corba/make/src/classes/build/tools/logutil/InputCode.java
author ihse
Thu, 05 Nov 2015 15:14:39 +0100
changeset 33442 f75b19e407af
parent 23067 7b20ffccad89
permissions -rw-r--r--
8141414: Deprecate configure source overriding Reviewed-by: erikj
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2306
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
     1
/*
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 3291
diff changeset
     2
 * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
2306
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
     4
 *
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 3291
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2306
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 3291
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2306
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    10
 *
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    15
 * accompanied this code).
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    16
 *
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    20
 *
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 3291
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 3291
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 3291
diff changeset
    23
 * questions.
2306
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    24
 */
23067
7b20ffccad89 8034769: Move logutil in corba to make/tools
erikj
parents: 5555
diff changeset
    25
package build.tools.logutil;
2306
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    26
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    27
public class InputCode {
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    28
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    29
  /**
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    30
   * The name of this code.
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    31
   */
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    32
  private final String name;
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    33
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    34
  /**
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    35
   * The code.
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    36
   */
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    37
  private final int code;
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    38
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    39
  /**
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    40
   * The log level for this code.
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    41
   */
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    42
  private final String logLevel;
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    43
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    44
  /**
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    45
   * The error message for this code.
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    46
   */
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    47
  private final String message;
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    48
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    49
  /**
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    50
   * Creates a new error code with the specified name, code,
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    51
   * log level and error message.
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    52
   *
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    53
   * @param name the name of the new code.
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    54
   * @param code the code itself.
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    55
   * @param logLevel the level of severity of this error.
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    56
   * @param message the error message for this code.
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    57
   */
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    58
  public InputCode(final String name, final int code,
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    59
                   final String logLevel, final String message) {
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    60
    this.name = name;
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    61
    this.code = code;
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    62
    this.logLevel = logLevel;
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    63
    this.message = message;
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    64
  }
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    65
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    66
  /**
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    67
   * Returns the name of this code.
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    68
   *
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    69
   * @return the name of the code.
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    70
   */
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    71
  public String getName() {
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    72
    return name;
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    73
  }
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    74
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    75
  /**
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    76
   * Returns the code.
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    77
   *
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    78
   * @return the code.
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    79
   */
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    80
  public int getCode() {
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    81
    return code;
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    82
  }
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    83
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    84
  /**
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    85
   * Returns the severity of this code.
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    86
   *
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    87
   * @return the log level severity of the code.
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    88
   */
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    89
  public String getLogLevel() {
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    90
    return logLevel;
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    91
  }
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    92
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    93
  /**
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    94
   * Returns the error message for this code.
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    95
   *
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    96
   * @return the error message for this code.
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    97
   */
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    98
  public String getMessage() {
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
    99
    return message;
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
   100
  }
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
   101
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
   102
  /**
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
   103
   * Returns a textual representation of this code.
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
   104
   *
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
   105
   * @return a textual representation.
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
   106
   */
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
   107
  public String toString() {
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
   108
    return getClass().getName() +
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
   109
      "[name=" + name +
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
   110
      ",code=" + code +
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
   111
      ",logLevel=" + logLevel +
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
   112
      ",message=" + message +
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
   113
      "]";
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
   114
  }
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
   115
70ca22b481e1 6695776: corba jscheme jar files in repository could be built from source
tbell
parents:
diff changeset
   116
}