public static String trimToType( String string, int trimType ) {
    switch ( trimType ) {
      case ValueMetaInterface.TRIM_TYPE_BOTH:
        return trim( string );
      case ValueMetaInterface.TRIM_TYPE_LEFT:
        return ltrim( string );
      case ValueMetaInterface.TRIM_TYPE_RIGHT:
        return rtrim( string );
      case ValueMetaInterface.TRIM_TYPE_NONE:
      default:
        return string;
    }
  }
@Test
  public void testTrimToType() {
    final String source = " trim me hard ";
    assertEquals( "trim me hard", Const.trimToType( source, ValueMetaInterface.TRIM_TYPE_BOTH ) );
    assertEquals( "trim me hard ", Const.trimToType( source, ValueMetaInterface.TRIM_TYPE_LEFT ) );
    assertEquals( " trim me hard", Const.trimToType( source, ValueMetaInterface.TRIM_TYPE_RIGHT ) );
    assertEquals( source, Const.trimToType( source, ValueMetaInterface.TRIM_TYPE_NONE ) );
  }