Record Class WPSiteInfo
java.lang.Object
java.lang.Record
net.ygbstudio.powerwp4j.models.entities.WPSiteInfo
- Record Components:
fullyQualifiedDomainName- the fully qualified domain name of the WordPress sitewpUser- the username for the WordPress sitewpAppPass- the application password for the WordPress site
public record WPSiteInfo(String fullyQualifiedDomainName, String wpUser, String wpAppPass)
extends Record
A record that represents basic site information required to interact with a WordPress site.
-
Constructor Summary
ConstructorsConstructorDescriptionWPSiteInfo(String fullyQualifiedDomainName, String wpUser, String wpAppPass) Creates an instance of aWPSiteInforecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull StringReturns the base URL of the WordPress REST API.final booleanIndicates whether some other object is "equal to" this one.static Optional<WPSiteInfo> fromConfigResource(String fileName) Returns an Optional ofWPSiteInfoloaded from the specified configuration resource properties file.static Optional<WPSiteInfo> fromEnv()Returns aWPSiteInfoloaded from the environment variables outlined inEnvironmentScope.Returns the value of thefullyQualifiedDomainNamerecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.Returns the value of thewpAppPassrecord component.wpUser()Returns the value of thewpUserrecord component.
-
Constructor Details
-
WPSiteInfo
Creates an instance of aWPSiteInforecord class.- Parameters:
fullyQualifiedDomainName- the value for thefullyQualifiedDomainNamerecord componentwpUser- the value for thewpUserrecord componentwpAppPass- the value for thewpAppPassrecord component
-
-
Method Details
-
apiBaseUrl
Returns the base URL of the WordPress REST API.- Returns:
- the base URL of the WordPress REST API
-
fromConfigResource
Returns an Optional ofWPSiteInfoloaded from the specified configuration resource properties file.- Parameters:
fileName- the name of the resource file to load properties from- Returns:
- an Optional of
WPSiteInfoloaded from the specified configuration resource file
-
fromEnv
Returns aWPSiteInfoloaded from the environment variables outlined inEnvironmentScope.- Returns:
- a
WPSiteInfoloaded from the environment variables
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
fullyQualifiedDomainName
Returns the value of thefullyQualifiedDomainNamerecord component.- Returns:
- the value of the
fullyQualifiedDomainNamerecord component
-
wpUser
Returns the value of thewpUserrecord component.- Returns:
- the value of the
wpUserrecord component
-
wpAppPass
Returns the value of thewpAppPassrecord component.- Returns:
- the value of the
wpAppPassrecord component
-