Record Class LmStudioSettings

java.lang.Object
java.lang.Record
fr.tiogars.chat.domains.lmstudio.models.LmStudioSettings

public record LmStudioSettings(@NotBlank @Size(max=2048) String baseUrl, @NotBlank @Size(max=255) String model, @Positive int timeoutSeconds, @Size(max=4096) @Pattern(regexp="(?:[A-Za-z0-9._~+/:\\-]+=*)?",message="token must be a valid LM Studio API token") String token) extends Record
  • Constructor Summary

    Constructors
    Constructor
    Description
    LmStudioSettings(@NotBlank @Size(max=2048) String baseUrl, @NotBlank @Size(max=255) String model, @Positive int timeoutSeconds, @Size(max=4096) @Pattern(regexp="(?:[A-Za-z0-9._~+/:\\-]+=*)?",message="token must be a valid LM Studio API token") String token)
    Creates an instance of a LmStudioSettings record class.
    LmStudioSettings(String baseUrl, String model, int timeoutSeconds)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotBlank @Size(max=2048) String
    Returns the value of the baseUrl record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    @AssertTrue(message="baseUrl must be an absolute HTTP(S) URL without credentials, query or fragment") boolean
     
    boolean
     
    @NotBlank @Size(max=255) String
    Returns the value of the model record component.
    @Positive int
    Returns the value of the timeoutSeconds record component.
    @Size(max=4096) @Pattern(regexp="(?:[A-Za-z0-9._~+/:\\-]+=*)?",message="token must be a valid LM Studio API token") String
    Returns the value of the token record component.
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • LmStudioSettings

      public LmStudioSettings(String baseUrl, String model, int timeoutSeconds)
    • LmStudioSettings

      public LmStudioSettings(@NotBlank @Size(max=2048) @NotBlank @Size(max=2048) String baseUrl, @NotBlank @Size(max=255) @NotBlank @Size(max=255) String model, @Positive @Positive int timeoutSeconds, @Size(max=4096) @Pattern(regexp="(?:[A-Za-z0-9._~+/:\\-]+=*)?",message="token must be a valid LM Studio API token") @Size(max=4096) @Pattern(regexp="(?:[A-Za-z0-9._~+/:\\-]+=*)?",message="token must be a valid LM Studio API token") String token)
      Creates an instance of a LmStudioSettings record class.
      Parameters:
      baseUrl - the value for the baseUrl record component
      model - the value for the model record component
      timeoutSeconds - the value for the timeoutSeconds record component
      token - the value for the token record component
  • Method Details

    • isTokenConfigured

      public boolean isTokenConfigured()
    • toString

      public 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
    • isBaseUrlValid

      @AssertTrue(message="baseUrl must be an absolute HTTP(S) URL without credentials, query or fragment") public @AssertTrue(message="baseUrl must be an absolute HTTP(S) URL without credentials, query or fragment") boolean isBaseUrlValid()
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • baseUrl

      @NotBlank @Size(max=2048) public @NotBlank @Size(max=2048) String baseUrl()
      Returns the value of the baseUrl record component.
      Returns:
      the value of the baseUrl record component
    • model

      @NotBlank @Size(max=255) public @NotBlank @Size(max=255) String model()
      Returns the value of the model record component.
      Returns:
      the value of the model record component
    • timeoutSeconds

      @Positive public @Positive int timeoutSeconds()
      Returns the value of the timeoutSeconds record component.
      Returns:
      the value of the timeoutSeconds record component
    • token

      @Size(max=4096) @Pattern(regexp="(?:[A-Za-z0-9._~+/:\\-]+=*)?", message="token must be a valid LM Studio API token") public @Size(max=4096) @Pattern(regexp="(?:[A-Za-z0-9._~+/:\\-]+=*)?",message="token must be a valid LM Studio API token") String token()
      Returns the value of the token record component.
      Returns:
      the value of the token record component