Camel
  1. Camel
  2. CAMEL-3710

Add String to char type converter

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: 2.7.0
    • Component/s: camel-core, camel-flatpack
    • Labels:
      None

      Description

      See nabble
      http://camel.465427.n5.nabble.com/How-to-specify-tab-delimiter-for-flatpack-tp3397320p3397320.html

      This makes it easier to configure the delimiter in flatpack as it uses a char type. And in the endpoint uri it's all String

        Activity

        Hide
        Claus Ibsen added a comment -

        Hmm we got it already in ObjectConverter

            @Converter
            public static char toChar(String value) {
                // must be 1 length string
                if (value == null || value.length() != 1) {
                    throw new IllegalArgumentException("String must have exactly a length of 1: " + value);
                }
                return value.toCharArray()[0];
            }
        
        Show
        Claus Ibsen added a comment - Hmm we got it already in ObjectConverter @Converter public static char toChar( String value) { // must be 1 length string if (value == null || value.length() != 1) { throw new IllegalArgumentException( " String must have exactly a length of 1: " + value); } return value.toCharArray()[0]; }
        Hide
        Claus Ibsen added a comment -

        duplicate of CAMEL-3045

        Show
        Claus Ibsen added a comment - duplicate of CAMEL-3045

          People

          • Assignee:
            Claus Ibsen
            Reporter:
            Claus Ibsen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development