1 23 24 31 package com.sun.enterprise.admin.event; 32 33 import java.util.regex.Pattern ; 34 35 41 public class ConfigChangeCategory { 42 43 private String configChangeCategoryName; 44 private Pattern configXPathPattern; 45 46 49 public ConfigChangeCategory() { 50 } 51 52 57 public ConfigChangeCategory(String name, String regex) { 58 configChangeCategoryName = name; 59 configXPathPattern = Pattern.compile(regex, Pattern.CASE_INSENSITIVE); 60 } 61 62 66 public ConfigChangeCategory(String name, Pattern regex) { 67 configChangeCategoryName = name; 68 configXPathPattern = regex; 69 } 70 71 74 public String getName() { 75 return configChangeCategoryName; 76 } 77 78 81 public void setName(String name) { 82 configChangeCategoryName = name; 83 } 84 85 89 public Pattern getConfigXPathPattern() { 90 return configXPathPattern; 91 } 92 93 98 public void setConfigXPathPattern(String regex) { 99 configXPathPattern = Pattern.compile(regex, Pattern.CASE_INSENSITIVE); 100 } 101 102 106 public void setConfigXPathPattern(Pattern regex) { 107 configXPathPattern = regex; 108 } 109 110 114 public boolean equals(ConfigChangeCategory other) { 115 if (configXPathPattern == null) { 116 if (other.configXPathPattern == null) { 117 return ((configChangeCategoryName != null) ? 118 configChangeCategoryName.equals( 119 other.configChangeCategoryName) : 120 (other.configChangeCategoryName == null)); 121 } else { 122 return false; 123 } 124 } else { 125 return configXPathPattern.equals(other.configXPathPattern); 126 } 127 } 128 } 129 | Popular Tags |