@Override public boolean isInner() { return delegate.isInner(); }
/** * @return true is message has MTI field * @exception ISOException if this is an inner message */ public boolean hasMTI() throws ISOException { if (isInner()) throw new ISOException ("can't hasMTI on inner message"); else return hasField(0); } /**
/** * @param mti new MTI * @exception ISOException if message is inner message */ public void setMTI (String mti) throws ISOException { if (isInner()) throw new ISOException ("can't setMTI on inner message"); set (new ISOField (0, mti)); } /**
/** * @return current MTI * @exception ISOException on inner message or MTI not set */ public String getMTI() throws ISOException { if (isInner()) throw new ISOException ("can't getMTI on inner message"); else if (!hasField(0)) throw new ISOException ("MTI not available"); return (String) getValue(0); }
@Test public void testIsInner2() throws Throwable { boolean result = new ISOMsg("testISOMsgMti").isInner(); assertFalse("result", result); }
@Test public void testIsInner1() throws Throwable { ISOMsg iSOMsg = new ISOMsg("testISOMsgMti"); iSOMsg.setFieldNumber(-2); boolean result = iSOMsg.isInner(); assertFalse("result", result); }
@Test public void testIsInner() throws Throwable { ISOMsg iSOMsg = new ISOMsg("testISOMsgMti"); iSOMsg.setFieldNumber(0); boolean result = iSOMsg.isInner(); assertTrue("result", result); }