/** * Mutant factory method for constructing a map where all entries use given * prefix */ public BeanPropertyMap renameAll(NameTransformer transformer) { if (transformer == null || (transformer == NameTransformer.NOP)) { return this; } // Try to retain insertion ordering as well final int len = _propsInOrder.length; ArrayList<SettableBeanProperty> newProps = new ArrayList<SettableBeanProperty>(len); for (int i = 0; i < len; ++i) { SettableBeanProperty prop = _propsInOrder[i]; // What to do with holes? For now, retain if (prop == null) { newProps.add(prop); continue; } newProps.add(_rename(prop, transformer)); } // should we try to re-index? Ordering probably changed but caller probably doesn't want changes... // 26-Feb-2017, tatu: Probably SHOULD handle renaming wrt Aliases? return new BeanPropertyMap(_caseInsensitive, newProps, _aliasDefs); }
/** * Mutant factory method for constructing a map where all entries use given * prefix */ public BeanPropertyMap renameAll(NameTransformer transformer) { if (transformer == null || (transformer == NameTransformer.NOP)) { return this; } // Try to retain insertion ordering as well final int len = _propsInOrder.length; ArrayList<SettableBeanProperty> newProps = new ArrayList<SettableBeanProperty>(len); for (int i = 0; i < len; ++i) { SettableBeanProperty prop = _propsInOrder[i]; // What to do with holes? For now, retain if (prop == null) { newProps.add(prop); continue; } newProps.add(_rename(prop, transformer)); } // should we try to re-index? Ordering probably changed but caller probably doesn't want changes... return new BeanPropertyMap(_caseInsensitive, newProps); }
/** * Mutant factory method for constructing a map where all entries use given * prefix */ public BeanPropertyMap renameAll(NameTransformer transformer) { if (transformer == null || (transformer == NameTransformer.NOP)) { return this; } // Try to retain insertion ordering as well final int len = _propsInOrder.length; ArrayList<SettableBeanProperty> newProps = new ArrayList<SettableBeanProperty>(len); for (int i = 0; i < len; ++i) { SettableBeanProperty prop = _propsInOrder[i]; // What to do with holes? For now, retain if (prop == null) { newProps.add(prop); continue; } newProps.add(_rename(prop, transformer)); } // should we try to re-index? Ordering probably changed but caller probably doesn't want changes... // 26-Feb-2017, tatu: Probably SHOULD handle renaming wrt Aliases? return new BeanPropertyMap(_caseInsensitive, newProps, _aliasDefs); }