package com.qoomon.banking.swift.message.submessage.field.subfield;

/**
 * Created by qoomon on 05/07/16.
 */
public enum DebitCreditMark {

    DEBIT,
    DEBIT_REVERSAL,
    CREDIT,
    CREDIT_REVERSAL;

    public static DebitCreditMark of(String value) {
        switch (value) {
            case "DEBIT":
            case "D":
                return DEBIT;
            case "CREDIT":
            case "C":
                return CREDIT;
            case "DEBIT_REVERSAL":
            case "DR":
                return DEBIT_REVERSAL;
            case "CREDIT_REVERSAL":
            case "CR":
                return CREDIT_REVERSAL;
            default:
                throw new IllegalArgumentException("No mapping found for value '" + value + "'");
        }
    }
}

@@ -150,30 +150,24 @@
 IT,%0A    
-DEBIT_
 REVERSAL
 ,%0A    CR
@@ -158,16 +158,22 @@
 REVERSAL
+_DEBIT
 ,%0A    CR
@@ -182,31 +182,24 @@
 IT,%0A    
-CREDIT_
 REVERSAL
 ;%0A%0A    p
@@ -190,16 +190,23 @@
 REVERSAL
+_CREDIT
 ;%0A%0A    p
@@ -454,30 +454,24 @@
   case %22
-DEBIT_
 REVERSAL
 %22:%0A     
@@ -454,32 +454,38 @@
   case %22REVERSAL
+_DEBIT
 %22:%0A            c
@@ -493,10 +493,10 @@
 se %22
-D
 R
+C
 %22:%0A 
@@ -521,22 +521,16 @@
 urn 
-DEBIT_
 REVERSAL
 ;%0A  
@@ -517,32 +517,38 @@
  return REVERSAL
+_DEBIT
 ;%0A            ca
@@ -551,31 +551,24 @@
   case %22
-CREDIT_
 REVERSAL
 %22:%0A     
@@ -559,16 +559,23 @@
 REVERSAL
+_CREDIT
 %22:%0A     
@@ -587,18 +587,18 @@
   case %22
-C
 R
+D
 %22:%0A     
@@ -619,23 +619,16 @@
 urn 
-CREDIT_
 REVERSAL
 ;%0A  
@@ -623,16 +623,23 @@
 REVERSAL
+_CREDIT
 ;%0A      

fix Debit credit mark codes