Package com.thunken.beacon
Class BeaconLink
java.lang.Object
com.thunken.beacon.BeaconLink
public final class BeaconLink extends Object
Main class for BEACON links. Link elements in BEACON format are given in abbreviated form of link tokens. Each link
is constructed from a mandatory source token, an optional annotation token, and an optional target token.
Link construction rules are based on the value of link construction BeaconMetaFields
.
Note: the current Javadoc for this project is incomplete. We rely on Lombok to generate boilerplate code, and Lombok does not plug into Javadoc. Generated methods and constructors are not included, and the Javadoc for other methods and constructors may be incomplete. See delombok and beacon#1 for more information.
-
Constructor Summary
Constructors Constructor Description BeaconLink(String sourceToken, String annotationToken, String targetToken, BeaconMetaFields metaFields)
-
Method Summary
Modifier and Type Method Description boolean
equals(Object object)
String
getAnnotation()
Returns this link's annotation.String
getAnnotationToken()
BeaconMetaFields
getMetaFields()
URI
getRelationType()
Returns this link's relation type.URI
getSourceIdentifier()
Returns this link's source identifier.String
getSourceToken()
URI
getTargetIdentifier()
Returns this link's target identifier.String
getTargetToken()
int
hashCode()
-
Constructor Details
-
BeaconLink
public BeaconLink(String sourceToken, String annotationToken, String targetToken, BeaconMetaFields metaFields)
-
-
Method Details
-
equals
-
getAnnotation
Returns this link's annotation. The annotation is constructed from the annotation token, if given, or from theBeaconMetaField.MESSAGE
meta field otherwise.- Returns:
- This link's annotation.
- See Also:
- https://gbv.github.io/beaconspec/beacon.html#link-construction
-
getAnnotationToken
-
getMetaFields
-
getRelationType
Returns this link's relation type. The relation type is set to theBeaconMetaField.RELATION
meta field if this field contains an URI. If this field contains an URI pattern, the relation type is constructed from this pattern by inserting the annotation token or the empty string if no annotation token is given.- Returns:
- This link's relation type.
- See Also:
- https://gbv.github.io/beaconspec/beacon.html#link-construction
-
getSourceIdentifier
Returns this link's source identifier. The source identifier is constructed from theBeaconMetaField.PREFIX
meta field URI pattern by inserting the source token.- Returns:
- This link's source identifier.
- See Also:
- https://gbv.github.io/beaconspec/beacon.html#link-construction
-
getSourceToken
-
getTargetIdentifier
Returns this link's target identifier. The target identifier is constructed from theBeaconMetaField.TARGET
meta field URI pattern by inserting the target token.- Returns:
- This link's target identifier.
- See Also:
- https://gbv.github.io/beaconspec/beacon.html#link-construction
-
getTargetToken
-
hashCode
public int hashCode()
-