1 19 package org.java.plugin.tools.mocks; 20 21 import java.net.URL ; 22 23 import org.java.plugin.registry.Documentation; 24 import org.java.plugin.registry.PluginDescriptor; 25 import org.java.plugin.registry.PluginFragment; 26 import org.java.plugin.registry.PluginRegistry; 27 import org.java.plugin.registry.Version; 28 29 32 public class MockPluginFragment extends MockIdentity implements PluginFragment { 33 private URL location; 34 private String pluginId; 35 private Version pluginVersion; 36 private PluginRegistry registry; 37 private String vendor; 38 private Version version; 39 private String docsPath; 40 private Documentation documentation; 41 42 45 public URL getLocation() { 46 return location; 47 } 48 49 53 public MockPluginFragment setLocation(final URL value) { 54 location = value; 55 return this; 56 } 57 58 61 public String getPluginId() { 62 return pluginId; 63 } 64 65 69 public MockPluginFragment setPluginId(final String value) { 70 pluginId = value; 71 return this; 72 } 73 74 77 public Version getPluginVersion() { 78 return pluginVersion; 79 } 80 81 85 public MockPluginFragment setPluginVersion(final Version value) { 86 pluginVersion = value; 87 return this; 88 } 89 90 93 public PluginRegistry getRegistry() { 94 return registry; 95 } 96 97 101 public MockPluginFragment setRegistry(final PluginRegistry value) { 102 registry = value; 103 return this; 104 } 105 106 109 public String getVendor() { 110 return vendor; 111 } 112 113 117 public MockPluginFragment setVendor(final String value) { 118 vendor = value; 119 return this; 120 } 121 122 125 public Version getVersion() { 126 return version; 127 } 128 129 133 public MockPluginFragment setVersion(final Version value) { 134 version = value; 135 return this; 136 } 137 138 142 public boolean matches(final PluginDescriptor descr) { 143 return getVersion().isCompatibleWith(descr.getVersion()); 144 } 145 146 149 public String getUniqueId() { 150 return getId() + '@' + getVersion(); 151 } 152 153 156 public String getDocsPath() { 157 return docsPath; 158 } 159 160 164 public MockPluginFragment setDocsPath(final String value) { 165 docsPath = value; 166 return this; 167 } 168 169 172 public Documentation getDocumentation() { 173 return documentation; 174 } 175 176 180 public MockPluginFragment setDocumentation(final Documentation value) { 181 documentation = value; 182 return this; 183 } 184 } 185 | Popular Tags |