Record Class Loader.PendingDeployment

java.lang.Object
java.lang.Record
dev.getelements.elements.app.serve.loader.Loader.PendingDeployment
Record Components:
uris - a predicate that returns true if the URI is new, false if it has already been recorded.
logs - a consumer of log messages
errors - a consumer of errors
Enclosing interface:
Loader

public static record Loader.PendingDeployment(Predicate<URI> uris, Consumer<String> logs, Consumer<String> warnings, Consumer<Throwable> errors) extends Record
Provides context and callbacks for pending deployments.
  • Constructor Details

    • PendingDeployment

      public PendingDeployment(Predicate<URI> uris, Consumer<String> logs, Consumer<String> warnings, Consumer<Throwable> errors)
      Creates an instance of a PendingDeployment record class.
      Parameters:
      uris - the value for the uris record component
      logs - the value for the logs record component
      warnings - the value for the warnings record component
      errors - the value for the errors record component
  • Method Details

    • log

      public void log(String message)
    • logf

      public void logf(String fmt, Object... args)
    • logWarning

      public void logWarning(String message)
    • logWarningf

      public void logWarningf(String fmt, Object... args)
    • log

      public static void log(Consumer<String> logs, String message)
      Logs a message to the deployment log.
      Parameters:
      message - the message
    • logf

      public static void logf(Consumer<String> log, String format, Object... args)
      Logs a formatted message to the deployment log.
      Parameters:
      format - the format
      args - the arguments
    • uri

      public void uri(URI uri)
      Records a URI to the deployment record.
      Parameters:
      uri - the uri
    • warning

      public <ThrowableT extends Throwable> ThrowableT warning(ThrowableT throwable)
      Records a Throwable to the deployment errors. Returns the same throwable for convenience such that it may be re-thrown.
      Parameters:
      throwable - the throwable
      Returns:
      the same throwable
    • error

      public <ThrowableT extends Throwable> ThrowableT error(ThrowableT throwable)
      Records a Throwable to the deployment errors. Returns the same throwable for convenience such that it may be re-thrown.
      Parameters:
      throwable - the throwable
      Returns:
      the same throwable
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • uris

      public Predicate<URI> uris()
      Returns the value of the uris record component.
      Returns:
      the value of the uris record component
    • logs

      public Consumer<String> logs()
      Returns the value of the logs record component.
      Returns:
      the value of the logs record component
    • warnings

      public Consumer<String> warnings()
      Returns the value of the warnings record component.
      Returns:
      the value of the warnings record component
    • errors

      public Consumer<Throwable> errors()
      Returns the value of the errors record component.
      Returns:
      the value of the errors record component