Class ExcelHyperlink

java.lang.Object
com.northconcepts.datapipeline.excel.ExcelHyperlink

public class ExcelHyperlink extends Object
Represents a hyperlink that can be attached to an Excel cell. Supports hyperlinks to document locations, URLs, email addresses, and files.
See Also:
  • Constructor Details

    • ExcelHyperlink

      public ExcelHyperlink(ExcelHyperlinkType type, String location)
      Creates a new ExcelHyperlink with the specified type and location.
      Parameters:
      type - the type of hyperlink
      location - the hyperlink location/address
  • Method Details

    • forCell

      public static ExcelHyperlink forCell(String sheetName, int columnIndex, int rowIndex)
      Creates a hyperlink to another cell in the same Excel workbook.
      Parameters:
      sheetName - the name of the sheet containing the target cell
      columnIndex - the zero-based column index of the target cell
      rowIndex - the zero-based row index of the target cell
      Returns:
      an ExcelHyperlink pointing to the specified cell
      Throws:
      DataException - if sheetName is null or empty, or if columnIndex or rowIndex is negative
    • forEmail

      public static ExcelHyperlink forEmail(String email)
      Creates a hyperlink to an email address.
      Parameters:
      email - the email address
      Returns:
      an ExcelHyperlink pointing to the email address
      Throws:
      DataException - if email is null or empty
    • forUrl

      public static ExcelHyperlink forUrl(String url)
      Creates a hyperlink to a URL.
      Parameters:
      url - the URL
      Returns:
      an ExcelHyperlink pointing to the URL
      Throws:
      DataException - if url is null or empty
    • forFile

      public static ExcelHyperlink forFile(String fileUri)
      Creates a hyperlink to a file.
      Parameters:
      fileUri - the file URI
      Returns:
      an ExcelHyperlink pointing to the file
      Throws:
      DataException - if fileUri is null or empty
    • fieldHasHyperlink

      public static FieldLocationPredicate fieldHasHyperlink()
      Creates a field location predicate that matches fields containing an ExcelHyperlink in their metadata.
      Returns:
      a predicate that returns true if the field has an associated ExcelHyperlink
    • getType

      public ExcelHyperlinkType getType()
      Gets the type of this hyperlink.
      Returns:
      the hyperlink type
    • getLocation

      public String getLocation()
      Gets the location/address of this hyperlink.
      Returns:
      the hyperlink location
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object