corrected a merge error

This commit is contained in:
jstaerk
2024-12-04 14:39:14 +01:00
parent 3f22cb3066
commit f4036a5b6d

View File

@@ -9,77 +9,72 @@ import com.fasterxml.jackson.annotation.JsonInclude;
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonInclude(JsonInclude.Include.NON_EMPTY)
public class IncludedNote { public class IncludedNote {
private String content; private String content;
private SubjectCode subjectCode; private SubjectCode subjectCode;
private static final String INCLUDE_START = "<ram:IncludedNote>"; private static final String INCLUDE_START = "<ram:IncludedNote>";
private static final String INCLUDE_END = "</ram:IncludedNote>"; private static final String INCLUDE_END = "</ram:IncludedNote>";
private static final String CONTENT_START = "<ram:Content>"; private static final String CONTENT_START = "<ram:Content>";
private static final String CONTENT_END = "</ram:Content>"; private static final String CONTENT_END = "</ram:Content>";
private static final String SUBJECT_CODE_START = "<ram:SubjectCode>"; private static final String SUBJECT_CODE_START = "<ram:SubjectCode>";
private static final String SUBJECT_CODE_END = "</ram:SubjectCode>"; private static final String SUBJECT_CODE_END = "</ram:SubjectCode>";
public IncludedNote(String content, SubjectCode subjectCode) { public IncludedNote(String content, SubjectCode subjectCode) {
this.content = content; this.content = content;
this.subjectCode = subjectCode; this.subjectCode = subjectCode;
} }
/** /**
* bean constructor * bean constructor
*/ */
public IncludedNote() { public IncludedNote() {
} }
public static IncludedNote generalNote(String content) { public static IncludedNote generalNote(String content) {
return new IncludedNote(content, SubjectCode.AAI); return new IncludedNote(content, SubjectCode.AAI);
} }
public static IncludedNote regulatoryNote(String content) { public static IncludedNote regulatoryNote(String content) {
return new IncludedNote(content, SubjectCode.REG); return new IncludedNote(content, SubjectCode.REG);
} }
public static IncludedNote legalNote(String content) { public static IncludedNote legalNote(String content) {
return new IncludedNote(content, SubjectCode.ABL); return new IncludedNote(content, SubjectCode.ABL);
} }
public static IncludedNote customsNote(String content) { public static IncludedNote customsNote(String content) {
return new IncludedNote(content, SubjectCode.CUS); return new IncludedNote(content, SubjectCode.CUS);
} }
public static IncludedNote sellerNote(String content) { public static IncludedNote sellerNote(String content) {
return new IncludedNote(content, SubjectCode.SUR); return new IncludedNote(content, SubjectCode.SUR);
} }
public static IncludedNote taxNote(String content) { public static IncludedNote taxNote(String content) {
return new IncludedNote(content, SubjectCode.TXD); return new IncludedNote(content, SubjectCode.TXD);
} }
public static IncludedNote introductionNote(String content) { public static IncludedNote introductionNote(String content) {
return new IncludedNote(content, SubjectCode.ACY); return new IncludedNote(content, SubjectCode.ACY);
} }
public static IncludedNote discountBonusNote(String content) { public static IncludedNote discountBonusNote(String content) {
return new IncludedNote(content, SubjectCode.AAK); return new IncludedNote(content, SubjectCode.AAK);
} }
public static IncludedNote unspecifiedNote(String content) { public static IncludedNote unspecifiedNote(String content) {
return new IncludedNote(content, null); return new IncludedNote(content, null);
} }
public String getContent() { public String getContent() {
return content; return content;
} }
public IncludedNote setContent(String content) { public SubjectCode getSubjectCode() {
this.content = content; return subjectCode;
return this; }
}
public SubjectCode getSubjectCode() {
return subjectCode;
}
public IncludedNote setSubjectCode(SubjectCode subjectCode) { public IncludedNote setSubjectCode(SubjectCode subjectCode) {
@@ -93,13 +88,13 @@ public class IncludedNote {
} }
public String toCiiXml(){ public String toCiiXml() {
String result = INCLUDE_START + CONTENT_START + String result = INCLUDE_START + CONTENT_START +
XMLTools.encodeXML(getContent() )+ CONTENT_END; XMLTools.encodeXML(getContent()) + CONTENT_END;
if (getSubjectCode() != null) { if (getSubjectCode() != null) {
result += SUBJECT_CODE_START + getSubjectCode() + SUBJECT_CODE_END; result += SUBJECT_CODE_START + getSubjectCode() + SUBJECT_CODE_END;
} }
return result + INCLUDE_END; return result + INCLUDE_END;
} }
} }