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(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[] 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 Key locale(Object locale) { return new Key(null, this.bundles, locale, null); }
public Key locale(Object locale) { return new Key(this.key, this.bundles, locale, this.args); }
public Key bundle(String bundle) { String[] newBundles = new String[] { bundle }; return new Key(this.key, newBundles, this.locale, this.args); }