Package sop

# Class Profile

java.lang.Object
sop.Profile

public class Profile extends Object
Tuple class bundling a profile name and description.

See Also:
  - SOP Spec - Profile

## Constructor Summary

Constructors
Constructor
Description
`Profile(String name)`
`Profile(String name, String description)`
Create a new `Profile` object.

## Method Summary

Modifier and Type
Method
Description
`Optional<String>`
`getDescription()`
Return a free-form description of the profile.
`String`
`getName()`
Return the name (also known as identifier) of the profile.
`boolean`
`hasDescription()`
`static Profile`
`parse(String string)`
Parse a `Profile` from its string representation.
`String`
`toString()`
Convert the profile into a String for displaying.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### Profile

public Profile(@Nonnull String name, @Nullable String description)
Create a new `Profile` object. The `toString()` representation MUST NOT exceed a length of 1000 bytes.

Parameters:
  `name` - profile name
  `description` - profile description

### Profile

public Profile(String name)

## Method Details

### parse

public static Profile parse(String string)
Parse a `Profile` from its string representation.

Parameters:
  `string` - string representation
Returns:
  profile

### getName

@Nonnull public String getName()
Return the name (also known as identifier) of the profile. A profile name is a UTF-8 string that has no whitespace in it. Similar to OpenPGP Notation names, profile names are divided into two namespaces: The IETF namespace and the user namespace. A profile name in the user namespace ends with the

    @

character (0x40) followed by a DNS domain name. A profile name in the IETF namespace does not have an

    @

character. A profile name in the user space is owned and controlled by the owner of the domain in the suffix. A profile name in the IETF namespace that begins with the string

    rfc

should have semantics that hew as closely as possible to the referenced RFC. Similarly, a profile name in the IETF namespace that begins with the string

    draft-

should have semantics that hew as closely as possible to the referenced Internet Draft.

Returns:
  name

### getDescription

@Nonnull public Optional<String> getDescription()
Return a free-form description of the profile.

Returns:
  description

### hasDescription

public boolean hasDescription()

### toString

public String toString()
Convert the profile into a String for displaying.

Overrides:
  `toString` in class `Object`
Returns:
  string