public Key insert(Object[] args) { Object[] newargs; if (this.args == null) { // we can just use the new ones newargs = args; } else { // create a new array to hold both the new and old args newargs = new Object[this.args.length + args.length]; // copy the old args into the newargs array System.arraycopy(this.args, 0, newargs, 0, this.args.length); // copy the args to be inserted into the newargs array System.arraycopy(args, 0, newargs, this.args.length, args.length); } return new Key(this.key, this.bundles, this.locale, newargs); }
public Key get(Object k) { return get(String.valueOf(k)); }
public String toString() { if (this.key == null) { return ""; } if (!getExists()) { getLog().warn("missing key: {}", this.key); return "???"+this.key+"???"; } return ResourceTool.this.render(this.rawValue, this.args); } }
public Key get(String key) { String newKey; if (this.key == null) { newKey = key; } else { newKey = this.key + '.' + key; } return new Key(newKey, this.bundles, this.locale, this.args); }
public Key bundle(String bundle) { return new Key(null, new String[] { bundle }, getLocale(), null); }
public Key insert(Object arg0, Object arg1) { return insert(new Object[] { arg0, arg1 }); }
public Key insert(List args) { return insert(args.toArray()); }
public Key insert(Object[] args) { return new Key(null, this.bundles, getLocale(), args); }
/** * Accepts objects and uses their string value as the key. * @param key key * @return Key object */ public Key get(String key) { return new Key(key, this.bundles, getLocale(), null); }
public boolean getExists() { return (getRaw() != null); }
public Key locale(Object locale) { return new Key(null, this.bundles, locale, null); }
public Key bundle(String bundle) { String[] newBundles = new String[] { bundle }; return new Key(this.key, newBundles, this.locale, this.args); }
public Key insert(Object arg) { return insert(new Object[] { arg }); }
public Key locale(Object locale) { return new Key(this.key, this.bundles, locale, this.args); }