com.atlassian.fisheye.spi.admin.data
Class SimpleLinker

java.lang.Object
  extended by com.atlassian.fisheye.spi.admin.data.SimpleLinker

public class SimpleLinker
extends java.lang.Object


Constructor Summary
SimpleLinker(java.util.regex.Pattern regex, java.lang.String href)
          Create a simple linker.
SimpleLinker(SimpleLinker sl)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.lang.String getDescription()
           
 java.lang.String getHref()
           
 java.util.regex.Pattern getRegex()
           
 int hashCode()
           
static boolean isValidHref(java.lang.String href)
          Whether href is a valid linker URL, meaning it must include the protocol as a prefix, e.g., "http://".
 void setDescription(java.lang.String description)
          Set the linker description.
 void setHref(java.lang.String href)
          Set the linker's href attribute.
 void setRegex(java.util.regex.Pattern regex)
          Set the regex used to match a linker.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleLinker

public SimpleLinker(java.util.regex.Pattern regex,
                    java.lang.String href)
Create a simple linker.

See setRegex(java.util.regex.Pattern) and setHref(String) for restrictions on the arguments.


SimpleLinker

public SimpleLinker(SimpleLinker sl)
Method Detail

getRegex

public java.util.regex.Pattern getRegex()

setRegex

public void setRegex(java.util.regex.Pattern regex)
Set the regex used to match a linker.

Throws:
java.lang.NullPointerException - if regex is null

getHref

public java.lang.String getHref()

setHref

public void setHref(java.lang.String href)
Set the linker's href attribute.

Throws:
java.lang.NullPointerException - if href is null
java.lang.IllegalArgumentException - if href isn't a valid URL (see isValidHref(String)

isValidHref

public static boolean isValidHref(java.lang.String href)
Whether href is a valid linker URL, meaning it must include the protocol as a prefix, e.g., "http://".

Throws:
java.lang.NullPointerException - if href is null

getDescription

public java.lang.String getDescription()

setDescription

public void setDescription(java.lang.String description)
Set the linker description.

Parameters:
description - the description, or null if you want to clear the description.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object