Record Components:
enabled - whether the branding is applied; switched off, it is kept
logo - the file name of the logo in LOGO_DIR of the configuration folder, or empty
public record Branding (boolean enabled,
String primary,
String secondary,
String tertiary,
String name,
String street,
String city,
String country,
String web,
String email, boolean inTitle,
String logo)
extends Record
The company branding (feature 16): up to three brand colours, the company name and address, and a logo. The logo is a file in
the configuration folder (portable), never a reference to a place outside of it.
Constructor Summary
Constructors
Branding (boolean enabled,
String primary,
String secondary,
String tertiary,
String name,
String street,
String city,
String country,
String web,
String email,
boolean inTitle,
String logo)
Creates an instance of a Branding record class.
Method Summary
All Methods Static Methods Instance Methods Concrete Methods
Returns the value of the city record component.
The company data as lines for the About dialog; empty when the branding is off or has no data.
Returns the value of the country record component.
Returns the value of the email record component.
boolean
Returns the value of the
enabled record component.
final boolean
Indicates whether some other object is "equal to" this one.
final int
Returns a hash code value for this object.
Copies a logo into the configuration folder after checking its type and size.
boolean
Returns the value of the inTitle record component.
Returns the value of the
logo record component.
The logo file in the configuration folder, if the branding has one and it is there.
Returns the value of the name record component.
Returns the value of the primary record component.
Returns the value of the secondary record component.
boolean
What the library page shows of the branding: needs the branding to be on and at least a logo, a name or a web address.
Returns the value of the street record component.
Returns the value of the tertiary record component.
Returns a string representation of this record class.
Returns the value of the web record component.
The company web address as a link that can be opened: https:// is added when there is no scheme; only http and https are accepted.
Field Details
LOGO_DIR
public static final String LOGO_DIR
See Also:
Constructor Details
Branding
public Branding (boolean enabled,
String primary,
String secondary,
String tertiary,
String name,
String street,
String city,
String country,
String web,
String email,
boolean inTitle,
String logo)
Creates an instance of a Branding record class.
Parameters:
enabled - the value for the enabled record component
primary - the value for the primary record component
secondary - the value for the secondary record component
tertiary - the value for the tertiary record component
name - the value for the name record component
street - the value for the street record component
city - the value for the city record component
country - the value for the country record component
web - the value for the web record component
email - the value for the email record component
inTitle - the value for the inTitle record component
logo - the value for the logo record component
Method Details
webUrl
The company web address as a link that can be opened: https:// is added when there is no scheme; only http and https are accepted.
showsOnLibrary
public boolean showsOnLibrary (Path configDir)
What the library page shows of the branding: needs the branding to be on and at least a logo, a name or a web address.
companyLines
The company data as lines for the About dialog; empty when the branding is off or has no data.
importLogo
Copies a logo into the configuration folder after checking its type and size.
Returns:
the file name to store in logo()
Throws:
IOException - with a readable message when the file is not usable
logoFile
The logo file in the configuration folder, if the branding has one and it is there.
toString
public final 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
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 '=='.
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.
enabled
public boolean enabled ()
Returns the value of the
enabled record component.
Returns:
the value of the enabled record component
primary
Returns the value of the primary record component.
Returns:
the value of the primary record component
secondary
Returns the value of the secondary record component.
Returns:
the value of the secondary record component
tertiary
Returns the value of the tertiary record component.
Returns:
the value of the tertiary record component
name
Returns the value of the name record component.
Returns:
the value of the name record component
street
Returns the value of the street record component.
Returns:
the value of the street record component
city
Returns the value of the city record component.
Returns:
the value of the city record component
country
Returns the value of the country record component.
Returns:
the value of the country record component
web
Returns the value of the web record component.
Returns:
the value of the web record component
email
Returns the value of the email record component.
Returns:
the value of the email record component
inTitle
public boolean inTitle ()
Returns the value of the inTitle record component.
Returns:
the value of the inTitle record component
logo
Returns the value of the
logo record component.
Returns:
the value of the logo record component