bufr/src/main/java/ucar/nc2/iosp/bufr/DataDescriptor.java
static public void transferInfo(List<DataDescriptor> fromList, List<DataDescriptor> toList) { // get info from proto message
    if (fromList.size() != toList.size())
      throw new IllegalArgumentException("list sizes dont match "+fromList.size()+" != "+toList.size());

    for (int i=0; i<fromList.size(); i++) {
      DataDescriptor from = fromList.get(i);
      DataDescriptor to = toList.get(i);
      to.refersTo = from.refersTo;
      to.name = from.name;

      if (from.getSubKeys() != null)
        transferInfo(from.getSubKeys(), to.getSubKeys());
    }
  }
static public void transferInfo(List<DataDescriptor> fromList, List<DataDescriptor> toList) { // get info from proto message
    if (fromList.size() != toList.size())
      throw new IllegalArgumentException("list sizes dont match "+fromList.size()+" != "+toList.size());

    for (int i=0; i<fromList.size(); i++) {
      DataDescriptor from = fromList.get(i);
      DataDescriptor to = toList.get(i);
      to.refersTo = from.refersTo;
      to.name = from.name;

      if (from.getSubKeys() != null)
        transferInfo(from.getSubKeys(), to.getSubKeys());
    }
  }
static public void transferInfo ( List < DataDescriptor > fromList , List < DataDescriptor > toList ) { // get info from proto message
 if ( fromList . size ( ) != toList . size ( ) ) throw new IllegalArgumentException ( "list sizes dont match " + fromList . size ( ) + " != " + toList . size ( ) ) ; for ( int i = 0 ; i < fromList . size ( ) ; i ++ ) { DataDescriptor from = fromList . get ( i ) ; DataDescriptor to = toList . get ( i ) ; to . refersTo = from . refersTo ; to . name = from . name ; if ( from . getSubKeys ( ) != null ) transferInfo ( from . getSubKeys ( ) , to . getSubKeys ( ) ) ; } }
Transfer info from the "proto message" to another message with the exact same structure.
@param fromList transfer from here
@param toList to here
Transfer info from the proto message to another message with the exact same structure .