APIdia Launch Partner
Top Inners Fields Constructors Methods
jdk.jpackage.internal.log

public final Record ConsoleLogger

extends Record
Class Inheritance
Record Components
out:Consumer<String> 
err:Consumer<String> 
timestampClock:Clock 
Imports
java.io.PrintWriter, java.time.Clock, .LocalTime, java.time.format.DateTimeFormatter, java.util.Objects, java.util.function.Consumer

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static record
pack-priv static record
pack-priv static record
pack-priv static record

Field Summary

Modifier and TypeField and Description
private final Consumer<String>
err

Record Component accessed by err().

private final Consumer<String>
out

Record Component accessed by out().

private final Clock
timestampClock

Record Component accessed by timestampClock().

Constructor Summary

AccessConstructor and Description
public
ConsoleLogger(Consumer<String> out, Consumer<String> err, Clock timestampClock)

public

Method Summary

Modifier and TypeMethod and Description
private static Consumer<String>
pack-priv ConsoleLogger
pack-priv ConsoleLogger
pack-priv ConsoleLogger
pack-priv ConsoleLogger
public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public Consumer<String>
err()

Record Component getter of err.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public Consumer<String>
out()

Record Component getter of out.

public Clock
timestampClock()

Record Component getter of timestampClock.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

errback to summary
private final Consumer<String> err

Record Component accessed by err().

outback to summary
private final Consumer<String> out

Record Component accessed by out().

timestampClockback to summary
private final Clock timestampClock

Record Component accessed by timestampClock().

Constructor Detail

ConsoleLoggerback to summary
public ConsoleLogger(Consumer<String> out, Consumer<String> err, Clock timestampClock)
ConsoleLoggerback to summary
public ConsoleLogger(Consumer<String> out, Consumer<String> err)

Method Detail

addTimestampsback to summary
private static Consumer<String> addTimestamps(Consumer<String> sink, Clock clock)
addTimestampsToErrback to summary
pack-priv ConsoleLogger addTimestampsToErr()
addTimestampsToOutback to summary
pack-priv ConsoleLogger addTimestampsToOut()
discardErrback to summary
pack-priv ConsoleLogger discardErr()
discardOutback to summary
pack-priv ConsoleLogger discardOut()
equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
errback to summary
public Consumer<String> err()

Record Component getter of err.

hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

outback to summary
public Consumer<String> out()

Record Component getter of out.

timestampClockback to summary
public Clock timestampClock()

Record Component getter of timestampClock.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

jdk.jpackage.internal.log back to summary

private final Record ConsoleLogger.AddingTimestampsConsumer

extends Record
implements Consumer<String>
Class Inheritance
All Implemented Interfaces
java.util.function.Consumer
Record Components
sink:Consumer<String> 
clock:Clock 

Field Summary

Modifier and TypeField and Description
private final Clock
clock

Record Component accessed by clock().

private final Consumer<String>
sink

Record Component accessed by sink().

private static final DateTimeFormatter

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
accept(String str)

Implements java.util.function.Consumer.accept.

Performs this operation on the given argument.

public Clock
clock()

Record Component getter of clock.

public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public Consumer<String>
sink()

Record Component getter of sink.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

clockback to summary
private final Clock clock

Record Component accessed by clock().

sinkback to summary
private final Consumer<String> sink

Record Component accessed by sink().

TIMESTAMP_FORMATTERback to summary
private static final DateTimeFormatter TIMESTAMP_FORMATTER

Constructor Detail

AddingTimestampsConsumerback to summary
pack-priv AddingTimestampsConsumer(Consumer<String> sink, Clock clock)

Method Detail

acceptback to summary
public void accept(String str)

Implements java.util.function.Consumer.accept.

Doc from java.util.function.Consumer.accept.

Performs this operation on the given argument.

Annotations
@Override
clockback to summary
public Clock clock()

Record Component getter of clock.

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

sinkback to summary
public Consumer<String> sink()

Record Component getter of sink.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

jdk.jpackage.internal.log back to summary

pack-priv final Record ConsoleLogger.ConsoleLoggerErrSink

extends Record
implements LoggerTrait
Class Inheritance
All Implemented Interfaces
jdk.jpackage.internal.log.LoggerTrait
Record Components
sink:PrintWriter 

Field Summary

Modifier and TypeField and Description
private final PrintWriter
sink

Record Component accessed by sink().

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public PrintWriter
sink()

Record Component getter of sink.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

sinkback to summary
private final PrintWriter sink

Record Component accessed by sink().

Constructor Detail

ConsoleLoggerErrSinkback to summary
pack-priv ConsoleLoggerErrSink(PrintWriter sink)

Method Detail

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

sinkback to summary
public PrintWriter sink()

Record Component getter of sink.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

jdk.jpackage.internal.log back to summary

pack-priv final Record ConsoleLogger.ConsoleLoggerOutSink

extends Record
implements LoggerTrait
Class Inheritance
All Implemented Interfaces
jdk.jpackage.internal.log.LoggerTrait
Record Components
sink:PrintWriter 

Field Summary

Modifier and TypeField and Description
private final PrintWriter
sink

Record Component accessed by sink().

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public PrintWriter
sink()

Record Component getter of sink.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

sinkback to summary
private final PrintWriter sink

Record Component accessed by sink().

Constructor Detail

ConsoleLoggerOutSinkback to summary
pack-priv ConsoleLoggerOutSink(PrintWriter sink)

Method Detail

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

sinkback to summary
public PrintWriter sink()

Record Component getter of sink.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

jdk.jpackage.internal.log back to summary

pack-priv final Record ConsoleLogger.ConsoleLoggerTimestampClock

extends Record
implements LoggerTrait
Class Inheritance
All Implemented Interfaces
jdk.jpackage.internal.log.LoggerTrait
Record Components
clock:Clock 

Field Summary

Modifier and TypeField and Description
private final Clock
clock

Record Component accessed by clock().

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Clock
clock()

Record Component getter of clock.

public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

clockback to summary
private final Clock clock

Record Component accessed by clock().

Constructor Detail

ConsoleLoggerTimestampClockback to summary
pack-priv ConsoleLoggerTimestampClock(Clock clock)

Method Detail

clockback to summary
public Clock clock()

Record Component getter of clock.

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.