Class MJavaInfo

java.lang.Object
com.io7m.montarre.api.MJavaInfo
All Implemented Interfaces:
MJavaInfoType

public final class MJavaInfo extends Object implements MJavaInfoType
Information involving the Java runtime.
  • Method Details

    • requiredJDKVersion

      public long requiredJDKVersion()
      Specified by:
      requiredJDKVersion in interface MJavaInfoType
      Returns:
      The minimum required JDK version
    • mainModule

      public String mainModule()
      The fully-qualified main module name used as the application entrypoint. For example, "com.io7m.montarre.cmdline/com.io7m.montarre.cmdline.MMain".
      Specified by:
      mainModule in interface MJavaInfoType
      Returns:
      The fully-qualified main module
    • extraOptions

      public List<String> extraOptions()
      Specified by:
      extraOptions in interface MJavaInfoType
      Returns:
      Extra options passed to the runtime
    • nativeAccessModules

      public Set<String> nativeAccessModules()
      Specified by:
      nativeAccessModules in interface MJavaInfoType
      Returns:
      The set of modules permitted to use native access
      See Also:
      • "https://docs.oracle.com/en/java/javase/25/core/restricted-methods.html"
    • runtimeImageKind

      public MRuntimeImageKind runtimeImageKind()
      Specified by:
      runtimeImageKind in interface MJavaInfoType
      Returns:
      The required runtime image kind
    • withRequiredJDKVersion

      public final MJavaInfo withRequiredJDKVersion(long value)
      Copy the current immutable object by setting a value for the requiredJDKVersion attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for requiredJDKVersion
      Returns:
      A modified copy or the this object
    • withMainModule

      public final MJavaInfo withMainModule(String value)
      Copy the current immutable object by setting a value for the mainModule attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for mainModule
      Returns:
      A modified copy or the this object
    • withExtraOptions

      public final MJavaInfo withExtraOptions(String... elements)
      Copy the current immutable object with elements that replace the content of extraOptions.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withExtraOptions

      public final MJavaInfo withExtraOptions(Iterable<String> elements)
      Copy the current immutable object with elements that replace the content of extraOptions. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of extraOptions elements to set
      Returns:
      A modified copy or this if not changed
    • withNativeAccessModules

      public final MJavaInfo withNativeAccessModules(String... elements)
      Copy the current immutable object with elements that replace the content of nativeAccessModules.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withNativeAccessModules

      public final MJavaInfo withNativeAccessModules(Iterable<String> elements)
      Copy the current immutable object with elements that replace the content of nativeAccessModules. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of nativeAccessModules elements to set
      Returns:
      A modified copy or this if not changed
    • withRuntimeImageKind

      public final MJavaInfo withRuntimeImageKind(MRuntimeImageKind value)
      Copy the current immutable object by setting a value for the runtimeImageKind attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for runtimeImageKind
      Returns:
      A modified copy or the this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of MJavaInfo that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: requiredJDKVersion, mainModule, extraOptions, nativeAccessModules, runtimeImageKind.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value MJavaInfo with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static MJavaInfo copyOf(MJavaInfoType instance)
      Creates an immutable copy of a MJavaInfoType value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable MJavaInfo instance
    • builder

      public static MJavaInfo.Builder builder()
      Creates a builder for MJavaInfo.
      MJavaInfo.builder()
         .setRequiredJDKVersion(long) // required requiredJDKVersion
         .setMainModule(String) // required mainModule
         .addExtraOptions|addAllExtraOptions(String) // extraOptions elements
         .addNativeAccessModules|addAllNativeAccessModules(String) // nativeAccessModules elements
         .setRuntimeImageKind(com.io7m.montarre.api.MRuntimeImageKind) // optional runtimeImageKind
         .build();
      
      Returns:
      A new MJavaInfo builder