public TextUnit createTextUnit(Long id,String name,String source,String note,String target,String targetBcp47Tag,XliffState state){
  TextUnit textUnit=new TextUnit(id.toString(),source);
  textUnit.setName(name);
  if (note != null) {
    textUnit.setSourceProperty(new Property(Property.NOTE,note));
  }
  if (target != null && targetBcp47Tag != null) {
    LocaleId localeId=LocaleId.fromBCP47(targetBcp47Tag);
    textUnit.setTarget(localeId,new TextContainer(target));
    if (state != null) {
      textUnit.setProperty(new Property("state",state.toString()));
    }
  }
  return textUnit;
}

public TextUnit createTextUnit ( Long id , String name , String source , String note , String target , String targetBcp47Tag , XliffState state ) { TextUnit textUnit = new TextUnit ( id . toString ( ) , source ) ; textUnit . setName ( name ) ; if ( note != null ) { textUnit . setSourceProperty ( new Property ( Property . NOTE , note ) ) ; } if ( target != null && targetBcp47Tag != null ) { LocaleId localeId = LocaleId . fromBCP47 ( targetBcp47Tag ) ; textUnit . setTarget ( localeId , new TextContainer ( target ) ) ; if ( state != null ) { textUnit . setProperty ( new Property ( "state" , state . toString ( ) ) ) ; } } return textUnit ; }
creates a textunit to be used later to generate a xliff
