objectos.lang.Note0 Maven / Gradle / Ivy
Show all versions of objectos-lang Show documentation
/*
* Copyright (C) 2022-2023 Objectos Software LTDA.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package objectos.lang;
/**
* A note that takes no arguments.
*
* @since 0.2
*/
public final class Note0 extends Note {
/**
* Creates a new note instance.
*
* @param source
* a name to identify the source class this note is bound to
* @param key
* a key that uniquely identifies this note within the given
* {@code source}
* @param level
* the severity of this note
*/
public Note0(String source, Object key, Level level) {
super(source, key, level);
}
/**
* Creates a new DEBUG note.
*
*
* The {@code source} and the {@code key} values are inferred from the method
* immediately calling this method.
*
*
* The {@code source} value is the binary name of class
* enclosing the method calling this method.
*
*
* The {@code key} value is a string containing the file
* name, a colon ':' and the line number where this method has been invoked.
*
* @return a new DEBUG note
*/
public static Note0 debug() {
return create(Level.DEBUG, Note0::new);
}
/**
* Creates a new ERROR note.
*
*
* The {@code source} and the {@code key} values are inferred from the method
* immediately calling this method.
*
*
* The {@code source} value is the binary name of class
* enclosing the method calling this method.
*
*
* The {@code key} value is a string containing the file
* name, a colon ':' and the line number where this method has been invoked.
*
* @return a new ERROR note
*/
public static Note0 error() {
return create(Level.ERROR, Note0::new);
}
/**
* Creates a new INFO note.
*
*
* The {@code source} and the {@code key} values are inferred from the method
* immediately calling this method.
*
*
* The {@code source} value is the binary name of class
* enclosing the method calling this method.
*
*
* The {@code key} value is a string containing the file
* name, a colon ':' and the line number where this method has been invoked.
*
* @return a new INFO note
*/
public static Note0 info() {
return create(Level.INFO, Note0::new);
}
/**
* Creates a new TRACE note.
*
*
* The {@code source} and the {@code key} values are inferred from the method
* immediately calling this method.
*
*
* The {@code source} value is the binary name of class
* enclosing the method calling this method.
*
*
* The {@code key} value is a string containing the file
* name, a colon ':' and the line number where this method has been invoked.
*
* @return a new TRACE note
*/
public static Note0 trace() {
return create(Level.TRACE, Note0::new);
}
/**
* Creates a new WARN note.
*
*
* The {@code source} and the {@code key} values are inferred from the method
* immediately calling this method.
*
*
* The {@code source} value is the binary name of class
* enclosing the method calling this method.
*
*
* The {@code key} value is a string containing the file
* name, a colon ':' and the line number where this method has been invoked.
*
* @return a new WARN note
*/
public static Note0 warn() {
return create(Level.WARN, Note0::new);
}
}