1 23 package org.apache.slide.macro; 24 25 import org.apache.slide.common.SlideException; 27 28 36 public interface CopyRouteRedirector { 37 38 39 46 public static class CopyRoute { 47 48 52 public static String SOURCE_MUST_NOT_BE_NULL = "Parameter 'sourceUri' must not be null"; 53 54 58 public static String DESTINATION_MUST_NOT_BE_NULL = "Parameter 'destinationUri' must not be null"; 59 60 61 64 protected String sourceUri = null; 65 66 69 protected String destinationUri = null; 70 71 82 public CopyRoute(String sourceUri, String destinationUri) throws IllegalArgumentException { 83 84 if (sourceUri == null) { 85 throw new IllegalArgumentException (SOURCE_MUST_NOT_BE_NULL); 86 } 87 if (destinationUri == null) { 88 throw new IllegalArgumentException (DESTINATION_MUST_NOT_BE_NULL); 89 } 90 this.sourceUri = sourceUri; 91 this.destinationUri = destinationUri; 92 } 93 94 99 public String getSourceUri() { 100 return sourceUri; 101 } 102 103 108 public String getDestinationUri() { 109 return destinationUri; 110 } 111 112 117 public String toString() { 118 return "CopyRoute["+getSourceUri()+", "+getDestinationUri()+"]"; 119 } 120 121 130 public boolean equals(Object other) { 131 boolean isEqual = false; 132 if (other instanceof CopyRoute) { 133 isEqual = 134 ((CopyRoute)other).getSourceUri().equals(getSourceUri()) && 135 ((CopyRoute)other).getDestinationUri().equals(getDestinationUri()); 136 } 137 return isEqual; 138 } 139 140 146 public int hashCode() { 147 return getSourceUri().hashCode() + 13*getDestinationUri().hashCode(); 148 } 149 } 150 151 152 153 164 public CopyRoute getRedirectedCopyRoute(CopyRoute copyRoute) throws SlideException; 165 166 } 167 168 | Popular Tags |