Class RecordEntity

java.lang.Object
codes.thischwa.cf.model.AbstractEntity
codes.thischwa.cf.model.RecordEntity
All Implemented Interfaces:
ResponseEntity

public class RecordEntity extends AbstractEntity
Represents a DNS getRecord entity within a specific zone.

Attributes defined in this class include:

  • DNS getRecord type such as "A" or "CNAME".
  • Name of the DNS getRecord.
  • Content of the DNS getRecord, such as an IP address.
  • Flags indicating whether the getRecord is proxiable or proxied.
  • TTL (Time-To-Live) for the DNS getRecord.
  • A locked status to indicate the immutability of the getRecord.
  • Zone-specific metadata including zone ID and name.
  • Timestamps for creation and modification.

Provides a static factory method build for creating a DNS getRecord with specific attributes.

  • Constructor Details

    • RecordEntity

      public RecordEntity()
      Initializes a new instance of the RecordEntity class and invokes the parent constructor from the AbstractEntity class. The RecordEntity class represents a DNS getRecord entity within a specific zone, encapsulating attributes such as type, name, content, TTL, and other related metadata.
  • Method Details

    • build

      public static RecordEntity build(String name, RecordType type, Integer ttl, String content)
      Builds and returns a RecordEntity instance with the specified attributes.
      Parameters:
      name - the name of the DNS getRecord
      type - the RecordType of the DNS getRecord
      ttl - the time-to-live (TTL) value for the DNS getRecord
      content - the content of the DNS getRecord, typically an IP address
      Returns:
      a RecordEntity populated with the provided attributes
    • build

      public static RecordEntity build(String id, String content)
      Builds and returns a RecordEntity instance with the specified ID and content.
      Parameters:
      id - the unique identifier for the DNS getRecord
      content - the content of the DNS getRecord, typically an IP address or other getRecord data
      Returns:
      a RecordEntity populated with the provided ID and content
    • build

      public static RecordEntity build(String id, String name, String type, Integer ttl, String content)
      Builds and returns a RecordEntity instance with the specified attributes.
      Parameters:
      id - the unique identifier for the DNS getRecord
      name - the name of the DNS getRecord
      type - the type of the DNS getRecord, represented as a string (e.g., "A", "CNAME")
      ttl - the time-to-live (TTL) value for the DNS getRecord
      content - the content of the DNS getRecord, typically an IP address or other getRecord data
      Returns:
      a RecordEntity populated with the provided attributes
      Throws:
      IllegalArgumentException - if the type string is not a valid RecordType
    • getSld

      public String getSld()
      Retrieves the short name (subdomain) of the DNS getRecord. If the name contains a dot ('.'), only the substring before the first dot is returned. This is useful for getting the subdomain part of a fully qualified domain name.
      Returns:
      the short name of the DNS getRecord (substring before the first dot), or the full name if no dot is present
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class AbstractEntity
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class AbstractEntity
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class AbstractEntity
    • getType

      public String getType()
    • getName

      public String getName()
    • getContent

      public String getContent()
    • getProxiable

      public Boolean getProxiable()
    • getProxied

      public Boolean getProxied()
    • getTtl

      public Integer getTtl()
    • getLocked

      public Boolean getLocked()
    • getZoneId

      @Nullable public @Nullable String getZoneId()
    • getZoneName

      @Nullable public @Nullable String getZoneName()
    • getModifiedOn

      @Nullable public @Nullable LocalDateTime getModifiedOn()
    • getCreatedOn

      @Nullable public @Nullable LocalDateTime getCreatedOn()
    • setType

      public void setType(String type)
    • setName

      public void setName(String name)
    • setContent

      public void setContent(String content)
    • setProxiable

      public void setProxiable(Boolean proxiable)
    • setProxied

      public void setProxied(Boolean proxied)
    • setTtl

      public void setTtl(Integer ttl)
    • setLocked

      public void setLocked(Boolean locked)
    • setZoneId

      public void setZoneId(@Nullable @Nullable String zoneId)
    • setZoneName

      public void setZoneName(@Nullable @Nullable String zoneName)
    • setModifiedOn

      public void setModifiedOn(@Nullable @Nullable LocalDateTime modifiedOn)
    • setCreatedOn

      public void setCreatedOn(@Nullable @Nullable LocalDateTime createdOn)
    • toString

      public String toString()
      Overrides:
      toString in class AbstractEntity