|
| 1 | +package com.arangodb.util; |
| 2 | + |
| 3 | +import java.util.Map; |
| 4 | + |
| 5 | +public class ImportOptionsJson extends ImportOptions { |
| 6 | + |
| 7 | + private String fromPrefix; |
| 8 | + private String toPrefix; |
| 9 | + |
| 10 | + /** |
| 11 | + * An optional prefix for the values in _from attributes. If specified, the |
| 12 | + * value is automatically prepended to each _from input value. This allows |
| 13 | + * specifying just the keys for _from. |
| 14 | + * |
| 15 | + * @return prefix for the values in _from attributes |
| 16 | + */ |
| 17 | + public String getFromPrefix() { |
| 18 | + return fromPrefix; |
| 19 | + } |
| 20 | + |
| 21 | + /** |
| 22 | + * An optional prefix for the values in _from attributes. If specified, the |
| 23 | + * value is automatically prepended to each _from input value. This allows |
| 24 | + * specifying just the keys for _from. |
| 25 | + * |
| 26 | + * @param fromPrefix |
| 27 | + * @return this ImportOptionsJson object |
| 28 | + */ |
| 29 | + public ImportOptionsJson setFromPrefix(String fromPrefix) { |
| 30 | + this.fromPrefix = fromPrefix; |
| 31 | + return this; |
| 32 | + } |
| 33 | + |
| 34 | + /** |
| 35 | + * An optional prefix for the values in _to attributes. If specified, the |
| 36 | + * value is automatically prepended to each _to input value. This allows |
| 37 | + * specifying just the keys for _to. |
| 38 | + * |
| 39 | + * @return prefix for the values in _to attributes |
| 40 | + */ |
| 41 | + public String getToPrefix() { |
| 42 | + return toPrefix; |
| 43 | + } |
| 44 | + |
| 45 | + /** |
| 46 | + * An optional prefix for the values in _to attributes. If specified, the |
| 47 | + * value is automatically prepended to each _to input value. This allows |
| 48 | + * specifying just the keys for _to. |
| 49 | + * |
| 50 | + * @param toPrefix |
| 51 | + * @return this ImportOptionsJson object |
| 52 | + */ |
| 53 | + public ImportOptionsJson setToPrefix(String toPrefix) { |
| 54 | + this.toPrefix = toPrefix; |
| 55 | + return this; |
| 56 | + } |
| 57 | + |
| 58 | + @Override |
| 59 | + public Map<String, Object> toMap() { |
| 60 | + Map<String, Object> map = super.toMap(); |
| 61 | + |
| 62 | + if (fromPrefix != null) { |
| 63 | + map.put("fromPrefix", fromPrefix); |
| 64 | + } |
| 65 | + |
| 66 | + if (toPrefix != null) { |
| 67 | + map.put("toPrefix", toPrefix); |
| 68 | + } |
| 69 | + |
| 70 | + return map; |
| 71 | + } |
| 72 | + |
| 73 | +} |
0 commit comments