@SuppressWarnings( "unchecked" ) public static Map<String, String> getMapFromConfigList( List list ) { Map<String, String> result = new HashMap<String, String>( list.size() ); for ( Object obj : list ) { CProps props = (CProps) obj; result.put( props.getKey(), props.getValue() ); } return result; } }
/** * Method upgradeCProps. * * @param cProps * @return CProps */ public org.sonatype.nexus.configuration.model.CProps upgradeCProps( org.sonatype.nexus.configuration.model.v2_7_0.CProps cProps ) { return upgradeCProps( cProps, new org.sonatype.nexus.configuration.model.CProps() ); } //-- org.sonatype.nexus.configuration.model.CProps upgradeCProps( org.sonatype.nexus.configuration.model.v2_7_0.CProps )
/** * Method upgradeCProps. * * @param cProps * @param value * @return CProps */ public org.sonatype.nexus.configuration.model.CProps upgradeCProps( org.sonatype.nexus.configuration.model.v2_7_0.CProps cProps, org.sonatype.nexus.configuration.model.CProps value ) { if ( cProps == null ) { return null; } // Convert field key value.setKey( cProps.getKey() ); // Convert field value value.setValue( cProps.getValue() ); return value; } //-- org.sonatype.nexus.configuration.model.CProps upgradeCProps( org.sonatype.nexus.configuration.model.v2_7_0.CProps, org.sonatype.nexus.configuration.model.CProps )
/** * Method writeCProps. * * @param cProps * @param serializer * @param tagName * @throws java.io.IOException */ private void writeCProps( CProps cProps, String tagName, XmlSerializer serializer ) throws java.io.IOException { serializer.startTag( NAMESPACE, tagName ); if ( cProps.getKey() != null ) { serializer.startTag( NAMESPACE, "key" ).text( cProps.getKey() ).endTag( NAMESPACE, "key" ); } if ( cProps.getValue() != null ) { serializer.startTag( NAMESPACE, "value" ).text( cProps.getValue() ).endTag( NAMESPACE, "value" ); } serializer.endTag( NAMESPACE, tagName ); } //-- void writeCProps( CProps, String, XmlSerializer )