|
| 1 | +package org.sourcelab.kafka.connect.apiclient.request.dto; |
| 2 | + |
| 3 | +import java.util.ArrayList; |
| 4 | +import java.util.Collection; |
| 5 | + |
| 6 | +/** |
| 7 | + * Represents results from the Connector Plugin Config Validation API end point. |
| 8 | + */ |
| 9 | +public final class ConnectorPluginConfigValidationResults { |
| 10 | + private String name; |
| 11 | + private int errorCount; |
| 12 | + private Collection<String> groups = new ArrayList<>(); |
| 13 | + private Collection<Config> configs = new ArrayList<>(); |
| 14 | + |
| 15 | + public String getName() { |
| 16 | + return name; |
| 17 | + } |
| 18 | + |
| 19 | + public int getErrorCount() { |
| 20 | + return errorCount; |
| 21 | + } |
| 22 | + |
| 23 | + public Collection<String> getGroups() { |
| 24 | + return groups; |
| 25 | + } |
| 26 | + |
| 27 | + public Collection<Config> getConfigs() { |
| 28 | + return configs; |
| 29 | + } |
| 30 | + |
| 31 | + @Override |
| 32 | + public String toString() { |
| 33 | + return "ConnectorPluginConfigValidationResults{" |
| 34 | + + "name='" + name + '\'' |
| 35 | + + ", errorCount=" + errorCount |
| 36 | + + ", groups=" + groups |
| 37 | + + ", configs=" + configs |
| 38 | + + '}'; |
| 39 | + } |
| 40 | + |
| 41 | + /** |
| 42 | + * Defines a config item. |
| 43 | + */ |
| 44 | + private final static class Config { |
| 45 | + private Definition definition; |
| 46 | + private Value value; |
| 47 | + |
| 48 | + public Definition getDefinition() { |
| 49 | + return definition; |
| 50 | + } |
| 51 | + |
| 52 | + public Value getValue() { |
| 53 | + return value; |
| 54 | + } |
| 55 | + |
| 56 | + @Override |
| 57 | + public String toString() { |
| 58 | + return "Config{" |
| 59 | + + "definition=" + definition |
| 60 | + + ", value=" + value |
| 61 | + + '}'; |
| 62 | + } |
| 63 | + |
| 64 | + /** |
| 65 | + * Represents the Definition of a config item. |
| 66 | + */ |
| 67 | + private final static class Definition { |
| 68 | + private String name; |
| 69 | + private String type; |
| 70 | + private boolean required = false; |
| 71 | + private String defaultValue; |
| 72 | + private String importance; |
| 73 | + private String documentation; |
| 74 | + private String group; |
| 75 | + private String width; |
| 76 | + private String displayName; |
| 77 | + private Collection<String> dependents = new ArrayList<>(); |
| 78 | + private int order; |
| 79 | + |
| 80 | + public String getName() { |
| 81 | + return name; |
| 82 | + } |
| 83 | + |
| 84 | + public String getType() { |
| 85 | + return type; |
| 86 | + } |
| 87 | + |
| 88 | + public boolean isRequired() { |
| 89 | + return required; |
| 90 | + } |
| 91 | + |
| 92 | + public String getDefaultValue() { |
| 93 | + return defaultValue; |
| 94 | + } |
| 95 | + |
| 96 | + public String getImportance() { |
| 97 | + return importance; |
| 98 | + } |
| 99 | + |
| 100 | + public String getDocumentation() { |
| 101 | + return documentation; |
| 102 | + } |
| 103 | + |
| 104 | + public String getGroup() { |
| 105 | + return group; |
| 106 | + } |
| 107 | + |
| 108 | + public String getWidth() { |
| 109 | + return width; |
| 110 | + } |
| 111 | + |
| 112 | + public String getDisplayName() { |
| 113 | + return displayName; |
| 114 | + } |
| 115 | + |
| 116 | + public Collection<String> getDependents() { |
| 117 | + return dependents; |
| 118 | + } |
| 119 | + |
| 120 | + public int getOrder() { |
| 121 | + return order; |
| 122 | + } |
| 123 | + |
| 124 | + @Override |
| 125 | + public String toString() { |
| 126 | + return "Definition{" |
| 127 | + + "name='" + name + '\'' |
| 128 | + + ", type='" + type + '\'' |
| 129 | + + ", required=" + required |
| 130 | + + ", defaultValue='" + defaultValue + '\'' |
| 131 | + + ", importance='" + importance + '\'' |
| 132 | + + ", documentation='" + documentation + '\'' |
| 133 | + + ", group='" + group + '\'' |
| 134 | + + ", width='" + width + '\'' |
| 135 | + + ", displayName='" + displayName + '\'' |
| 136 | + + ", dependents=" + dependents |
| 137 | + + ", order=" + order |
| 138 | + + '}'; |
| 139 | + } |
| 140 | + } |
| 141 | + |
| 142 | + /** |
| 143 | + * Defines a config item value. |
| 144 | + */ |
| 145 | + private final static class Value { |
| 146 | + private String name; |
| 147 | + private String value; |
| 148 | + private Collection<String> recommendedValues = new ArrayList<>(); |
| 149 | + private Collection<String> errors = new ArrayList<>(); |
| 150 | + private boolean visible = true; |
| 151 | + |
| 152 | + public String getName() { |
| 153 | + return name; |
| 154 | + } |
| 155 | + |
| 156 | + public String getValue() { |
| 157 | + return value; |
| 158 | + } |
| 159 | + |
| 160 | + public Collection<String> getRecommendedValues() { |
| 161 | + return recommendedValues; |
| 162 | + } |
| 163 | + |
| 164 | + public Collection<String> getErrors() { |
| 165 | + return errors; |
| 166 | + } |
| 167 | + |
| 168 | + public boolean isVisible() { |
| 169 | + return visible; |
| 170 | + } |
| 171 | + |
| 172 | + @Override |
| 173 | + public String toString() { |
| 174 | + return "Value{" |
| 175 | + + "name='" + name + '\'' |
| 176 | + + ", value='" + value + '\'' |
| 177 | + + ", recommendedValues=" + recommendedValues |
| 178 | + + ", errors=" + errors |
| 179 | + + ", visible=" + visible |
| 180 | + + '}'; |
| 181 | + } |
| 182 | + } |
| 183 | + } |
| 184 | +} |
0 commit comments