Package codes.thischwa.cf.model
Class RecordEntity
java.lang.Object
codes.thischwa.cf.model.AbstractEntity
codes.thischwa.cf.model.RecordEntity
- All Implemented Interfaces:
ResponseEntity
Represents a DNS record entity within a specific zone.
Attributes defined in this class include:
- DNS record type such as "A" or "CNAME".
- Name of the DNS record.
- Content of the DNS record, such as an IP address.
- Flags indicating whether the record is proxiable or proxied.
- TTL (Time-To-Live) for the DNS record.
- A locked status to indicate the immutability of the record.
- Zone-specific metadata including zone ID and name.
- Timestamps for creation and modification.
Provides a static factory method build for creating a DNS record with specific
attributes.
-
Constructor Summary
ConstructorsConstructorDescriptionInitializes a new instance of the RecordEntity class and invokes the parent constructor from the AbstractEntity class. -
Method Summary
Modifier and TypeMethodDescriptionstatic RecordEntitybuild(String name, RecordType type, Integer ttl, String content) Builds and returns aRecordEntityinstance with the specified attributes.static RecordEntityBuilds and returns aRecordEntityinstance with the specified ID and content.static RecordEntityBuilds and returns aRecordEntityinstance with the specified attributes.getSld()Retrieves the short name (subdomain) of the DNS record.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface codes.thischwa.cf.model.ResponseEntity
getId
-
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 record entity within a specific zone, encapsulating attributes such as type, name, content, TTL, and other related metadata.
-
-
Method Details
-
build
Builds and returns aRecordEntityinstance with the specified attributes.- Parameters:
name- the name of the DNS recordtype- theRecordTypeof the DNS recordttl- the time-to-live (TTL) value for the DNS recordcontent- the content of the DNS record, typically an IP address- Returns:
- a
RecordEntitypopulated with the provided attributes
-
build
Builds and returns aRecordEntityinstance with the specified ID and content.- Parameters:
id- the unique identifier for the DNS recordcontent- the content of the DNS record, typically an IP address or other record data- Returns:
- a
RecordEntitypopulated with the provided ID and content
-
build
Builds and returns aRecordEntityinstance with the specified attributes.- Parameters:
id- the unique identifier for the DNS recordname- the name of the DNS recordtype- the type of the DNS record, represented as a string (e.g., "A", "CNAME")ttl- the time-to-live (TTL) value for the DNS recordcontent- the content of the DNS record, typically an IP address or other record data- Returns:
- a
RecordEntitypopulated with the provided attributes - Throws:
IllegalArgumentException- if the type string is not a valid RecordType
-
getSld
Retrieves the short name (subdomain) of the DNS record. 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 record (substring before the first dot), or the full name if no dot is present
-