View Javadoc
1   /*
2    * CSVeed (https://github.com/42BV/CSVeed)
3    *
4    * Copyright 2013-2023 CSVeed.
5    *
6    * All rights reserved. This program and the accompanying materials
7    * are made available under the terms of The Apache Software License,
8    * Version 2.0 which accompanies this distribution, and is available at
9    * https://www.apache.org/licenses/LICENSE-2.0.txt
10   */
11  package org.csveed.bean.conversion;
12  
13  /**
14   * The Class CharArrayConverter.
15   */
16  public class CharArrayConverter extends AbstractConverter<char[]> {
17  
18      /**
19       * Instantiates a new char array converter.
20       */
21      public CharArrayConverter() {
22          super(char[].class);
23      }
24  
25      @Override
26      public char[] fromString(String text) throws Exception {
27          return text != null ? text.toCharArray() : null;
28      }
29  
30      @Override
31      public String toString(char[] value) throws Exception {
32          return value != null ? new String(value) : "";
33      }
34  
35  }