Commit c8eb4f83 authored by Christian P. MOMON's avatar Christian P. MOMON
Browse files

Fixed licence headers.

parent 03e723cf
/**
* Copyright (C) 2013-2017 Christian Pierre MOMON
*
* This file is part of Devinsy-utils.
* This file is part of devinsy-strings.
*
* Devinsy-utils is free software: you can redistribute it and/or modify
* devinsy-strings is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Devinsy-utils is distributed in the hope that it will be useful,
* devinsy-strings is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Devinsy-utils. If not, see <http://www.gnu.org/licenses/>
* along with devinsy-strings. If not, see <http://www.gnu.org/licenses/>
*/
package fr.devinsy.util.strings;
......
/**
* Copyright (C) 2008-2010, 2013-2015 Christian Pierre MOMON
* Copyright (C) 2008-2010 Christian Pierre MOMON
* Copyright (C) 2013-2015 Christian Pierre MOMON
* Copyright (C) 2017 Christian Pierre MOMON
*
* This file is part of Devinsy-utils.
* This file is part of devinsy-strings.
*
* Devinsy-utils is free software: you can redistribute it and/or modify
* devinsy-strings is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Devinsy-utils is distributed in the hope that it will be useful,
* devinsy-strings is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Devinsy-utils. If not, see <http://www.gnu.org/licenses/>
* along with devinsy-strings. If not, see <http://www.gnu.org/licenses/>
*/
package fr.devinsy.util.strings;
......@@ -29,9 +31,10 @@ import java.util.Iterator;
import org.apache.commons.lang3.StringUtils;
/**
* This class is a collection of String objects with specific methods. It makes
* possible to build a string without any copy. The goal is to optimize the
* building of strings where they are lot of concatenation action.
* The <code>StringList</code> class is a collection of String objects with
* specific methods. It makes possible to build a string without any copy. The
* goal is to optimize the building of strings where they are lot of
* concatenation action.
*
*/
public class StringList extends ArrayList<String> implements CharSequence
......
/**
* Copyright (C) 2014-2015 Christian Pierre MOMON
* Copyright (C) 2017 Christian Pierre MOMON
*
* This file is part of Devinsy-utils.
* This file is part of devinsy-strings.
*
* Devinsy-utils is free software: you can redistribute it and/or modify
* devinsy-strings is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Devinsy-utils is distributed in the hope that it will be useful,
* devinsy-strings is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Devinsy-utils. If not, see <http://www.gnu.org/licenses/>
* along with devinsy-strings. If not, see <http://www.gnu.org/licenses/>
*/
package fr.devinsy.util.strings;
......
/**
* Copyright (C) 2013-2015 Christian Pierre MOMON
* Copyright (C) 2017 Christian Pierre MOMON
*
* This file is part of Devinsy-utils.
* This file is part of devinsy-strings.
*
* Devinsy-utils is free software: you can redistribute it and/or modify
* devinsy-strings is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Devinsy-utils is distributed in the hope that it will be useful,
* devinsy-strings is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Devinsy-utils. If not, see <http://www.gnu.org/licenses/>
* along with devinsy-strings. If not, see <http://www.gnu.org/licenses/>
*/
package fr.devinsy.util.strings;
......
/**
* Copyright (C) 2013-2015 Christian Pierre MOMON
* Copyright (C) 2017 Christian Pierre MOMON
*
* This file is part of Devinsy-utils.
* This file is part of devinsy-strings.
*
* Devinsy-utils is free software: you can redistribute it and/or modify
* devinsy-strings is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Devinsy-utils is distributed in the hope that it will be useful,
* devinsy-strings is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Devinsy-utils. If not, see <http://www.gnu.org/licenses/>
* along with devinsy-strings. If not, see <http://www.gnu.org/licenses/>
*/
package fr.devinsy.util.strings;
......
/**
* Copyright (C) 2013-2017 Christian Pierre MOMON
*
* This file is part of Devinsy-utils.
* This file is part of devinsy-strings.
*
* Devinsy-utils is free software: you can redistribute it and/or modify
* devinsy-strings is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Devinsy-utils is distributed in the hope that it will be useful,
* devinsy-strings is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Devinsy-utils. If not, see <http://www.gnu.org/licenses/>
* along with devinsy-strings. If not, see <http://www.gnu.org/licenses/>
*/
package fr.devinsy.util.strings;
......
/**
* Copyright (C) 2008-2010, 2013-2016 Christian Pierre MOMON
* Copyright (C) 2008-2010 Christian Pierre MOMON
* Copyright (C) 2013-2016 Christian Pierre MOMON
* Copyright (C) 2017 Christian Pierre MOMON
*
* This file is part of Devinsy-utils.
* This file is part of devinsy-strings.
*
* Devinsy-utils is free software: you can redistribute it and/or modify
* devinsy-strings is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Devinsy-utils is distributed in the hope that it will be useful,
* devinsy-strings is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Devinsy-utils. If not, see <http://www.gnu.org/licenses/>
* along with devinsy-strings. If not, see <http://www.gnu.org/licenses/>
*/
package fr.devinsy.util.strings;
......
/**
* Copyright (C) 2013-2017 Christian Pierre MOMON
*
* This file is part of Devinsy-utils.
* This file is part of devinsy-strings.
*
* Devinsy-utils is free software: you can redistribute it and/or modify
* devinsy-strings is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Devinsy-utils is distributed in the hope that it will be useful,
* devinsy-strings is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Devinsy-utils. If not, see <http://www.gnu.org/licenses/>
* along with devinsy-strings. If not, see <http://www.gnu.org/licenses/>
*/
package fr.devinsy.util.strings;
......
/**
* Copyright (C) 2014-2016 Christian Pierre MOMON
* Copyright (C) 2014-2017 Christian Pierre MOMON
*
* This file is part of Devinsy-utils.
* This file is part of devinsy-strings.
*
* Devinsy-utils is free software: you can redistribute it and/or modify
* devinsy-strings is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Devinsy-utils is distributed in the hope that it will be useful,
* devinsy-strings is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Devinsy-utils. If not, see <http://www.gnu.org/licenses/>
* along with devinsy-strings. If not, see <http://www.gnu.org/licenses/>
*/
package fr.devinsy.util.strings;
......
/**
* Copyright (C) 2013,2014 Christian Pierre MOMON
* Copyright (C) 2013,2014,2017 Christian Pierre MOMON
*
* This file is part of Devinsy-utils.
* This file is part of devinsy-strings.
*
* Devinsy-utils is free software: you can redistribute it and/or modify
* devinsy-strings is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Devinsy-utils is distributed in the hope that it will be useful,
* devinsy-strings is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Devinsy-utils. If not, see <http://www.gnu.org/licenses/>
* along with devinsy-strings. If not, see <http://www.gnu.org/licenses/>
*/
package fr.devinsy.util.strings;
......
/**
* Copyright (C) 2013,2014 Christian Pierre MOMON
* Copyright (C) 2013,2014,2017 Christian Pierre MOMON
*
* This file is part of Devinsy-utils.
* This file is part of devinsy-strings.
*
* Devinsy-utils is free software: you can redistribute it and/or modify
* devinsy-strings is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Devinsy-utils is distributed in the hope that it will be useful,
* devinsy-strings is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Devinsy-utils. If not, see <http://www.gnu.org/licenses/>
* along with devinsy-strings. If not, see <http://www.gnu.org/licenses/>
*/
package fr.devinsy.util.strings;
......@@ -34,141 +34,141 @@ import org.junit.Test;
*/
public class StringListUtilsTest
{
private static org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(StringListUtilsTest.class);
private static org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(StringListUtilsTest.class);
/**
/**
*
*/
@Before
public void before()
{
BasicConfigurator.configure();
Logger.getRootLogger().setLevel(Level.ERROR);
}
@Before
public void before()
{
BasicConfigurator.configure();
Logger.getRootLogger().setLevel(Level.ERROR);
}
/**
/**
*
*/
@Test
public void testContainsBlank01()
{
Assert.assertFalse(StringListUtils.containsBlank((Collection<String>) null));
Assert.assertFalse(StringListUtils.containsBlank(new StringList("aaa", "bbb", "ccc")));
Assert.assertTrue(StringListUtils.containsBlank(new StringList("aaa", null, "ccc")));
Assert.assertTrue(StringListUtils.containsBlank(new StringList("aaa", "", "ccc")));
Assert.assertTrue(StringListUtils.containsBlank(new StringList("aaa", " ", "ccc")));
}
@Test
public void testContainsBlank01()
{
Assert.assertFalse(StringListUtils.containsBlank((Collection<String>) null));
Assert.assertFalse(StringListUtils.containsBlank(new StringList("aaa", "bbb", "ccc")));
Assert.assertTrue(StringListUtils.containsBlank(new StringList("aaa", null, "ccc")));
Assert.assertTrue(StringListUtils.containsBlank(new StringList("aaa", "", "ccc")));
Assert.assertTrue(StringListUtils.containsBlank(new StringList("aaa", " ", "ccc")));
}
/**
/**
*
*/
@Test
public void testContainsBlank02()
{
Assert.assertFalse(StringListUtils.containsBlank((String[]) null));
Assert.assertFalse(StringListUtils.containsBlank("aaa", "bbb", "ccc"));
Assert.assertTrue(StringListUtils.containsBlank("aaa", null, "ccc"));
Assert.assertTrue(StringListUtils.containsBlank("aaa", "", "ccc"));
Assert.assertTrue(StringListUtils.containsBlank("aaa", " ", "ccc"));
}
@Test
public void testContainsBlank02()
{
Assert.assertFalse(StringListUtils.containsBlank((String[]) null));
Assert.assertFalse(StringListUtils.containsBlank("aaa", "bbb", "ccc"));
Assert.assertTrue(StringListUtils.containsBlank("aaa", null, "ccc"));
Assert.assertTrue(StringListUtils.containsBlank("aaa", "", "ccc"));
Assert.assertTrue(StringListUtils.containsBlank("aaa", " ", "ccc"));
}
/**
/**
*
*/
@Test
public void testContainsBlank03()
{
Assert.assertFalse(StringListUtils.containsBlank((ArrayList<String>) null));
ArrayList<String> source = new ArrayList<String>();
source.add("aaa");
source.add("bbb");
source.add("ccc");
Assert.assertFalse(StringListUtils.containsBlank(source));
source.set(1, null);
Assert.assertTrue(StringListUtils.containsBlank(source));
source.set(1, "");
Assert.assertTrue(StringListUtils.containsBlank(source));
source.set(1, " ");
Assert.assertTrue(StringListUtils.containsBlank(source));
}
@Test
public void testContainsBlank03()
{
Assert.assertFalse(StringListUtils.containsBlank((ArrayList<String>) null));
ArrayList<String> source = new ArrayList<String>();
source.add("aaa");
source.add("bbb");
source.add("ccc");
Assert.assertFalse(StringListUtils.containsBlank(source));
source.set(1, null);
Assert.assertTrue(StringListUtils.containsBlank(source));
source.set(1, "");
Assert.assertTrue(StringListUtils.containsBlank(source));
source.set(1, " ");
Assert.assertTrue(StringListUtils.containsBlank(source));
}
/**
/**
*
*/
@Test
public void testContainsEmpty01()
{
Assert.assertFalse(StringListUtils.containsEmpty((Collection<String>) null));
Assert.assertFalse(StringListUtils.containsEmpty(new StringList("aaa", "bbb", "ccc")));
Assert.assertTrue(StringListUtils.containsEmpty(new StringList("aaa", null, "ccc")));
Assert.assertTrue(StringListUtils.containsEmpty(new StringList("aaa", "", "ccc")));
}
@Test
public void testContainsEmpty01()
{
Assert.assertFalse(StringListUtils.containsEmpty((Collection<String>) null));
Assert.assertFalse(StringListUtils.containsEmpty(new StringList("aaa", "bbb", "ccc")));
Assert.assertTrue(StringListUtils.containsEmpty(new StringList("aaa", null, "ccc")));
Assert.assertTrue(StringListUtils.containsEmpty(new StringList("aaa", "", "ccc")));
}
/**
/**
*
*/
@Test
public void testContainsEmpty02()
{
Assert.assertFalse(StringListUtils.containsEmpty((String[]) null));
Assert.assertFalse(StringListUtils.containsEmpty("aaa", "bbb", "ccc"));
Assert.assertTrue(StringListUtils.containsEmpty("aaa", null, "ccc"));
Assert.assertTrue(StringListUtils.containsEmpty("aaa", "", "ccc"));
}
@Test
public void testContainsEmpty02()
{
Assert.assertFalse(StringListUtils.containsEmpty((String[]) null));
Assert.assertFalse(StringListUtils.containsEmpty("aaa", "bbb", "ccc"));
Assert.assertTrue(StringListUtils.containsEmpty("aaa", null, "ccc"));
Assert.assertTrue(StringListUtils.containsEmpty("aaa", "", "ccc"));
}
/**
/**
*
*/
@Test
public void testContainsEmpty03()
{
Assert.assertFalse(StringListUtils.containsEmpty((ArrayList<String>) null));
ArrayList<String> source = new ArrayList<String>();
source.add("aaa");
source.add("bbb");
source.add("ccc");
Assert.assertFalse(StringListUtils.containsEmpty(source));
source.set(1, null);
Assert.assertTrue(StringListUtils.containsEmpty(source));
source.set(1, "");
Assert.assertTrue(StringListUtils.containsEmpty(source));
}
@Test
public void testContainsEmpty03()
{
Assert.assertFalse(StringListUtils.containsEmpty((ArrayList<String>) null));
ArrayList<String> source = new ArrayList<String>();
source.add("aaa");
source.add("bbb");
source.add("ccc");
Assert.assertFalse(StringListUtils.containsEmpty(source));
source.set(1, null);
Assert.assertTrue(StringListUtils.containsEmpty(source));
source.set(1, "");
Assert.assertTrue(StringListUtils.containsEmpty(source));
}
/**
/**
*
*/
@Test
public void testContainsNull01()
{
Assert.assertFalse(StringListUtils.containsNull((Collection<String>) null));
Assert.assertFalse(StringListUtils.containsNull(new StringList("aaa", "bbb", "ccc")));
Assert.assertTrue(StringListUtils.containsNull(new StringList("aaa", null, "ccc")));
}
@Test
public void testContainsNull01()
{
Assert.assertFalse(StringListUtils.containsNull((Collection<String>) null));
Assert.assertFalse(StringListUtils.containsNull(new StringList("aaa", "bbb", "ccc")));
Assert.assertTrue(StringListUtils.containsNull(new StringList("aaa", null, "ccc")));
}
/**
/**
*
*/
@Test
public void testContainsNull02()
{
Assert.assertFalse(StringListUtils.containsNull((String[]) null));
Assert.assertFalse(StringListUtils.containsNull("aaa", "bbb", "ccc"));
Assert.assertTrue(StringListUtils.containsNull("aaa", null, "ccc"));
}
@Test
public void testContainsNull02()
{
Assert.assertFalse(StringListUtils.containsNull((String[]) null));
Assert.assertFalse(StringListUtils.containsNull("aaa", "bbb", "ccc"));
Assert.assertTrue(StringListUtils.containsNull("aaa", null, "ccc"));
}
/**
/**
*
*/
@Test
public void testContainsNull03()
{
Assert.assertFalse(StringListUtils.containsNull((ArrayList<String>) null));
ArrayList<String> source = new ArrayList<String>();
source.add("aaa");
source.add("bbb");
source.add("ccc");
Assert.assertFalse(StringListUtils.containsNull(source));
source.set(1, null);
Assert.assertTrue(StringListUtils.containsNull(source));
}
@Test
public void testContainsNull03()
{
Assert.assertFalse(StringListUtils.containsNull((ArrayList<String>) null));
ArrayList<String> source = new ArrayList<String>();
source.add("aaa");
source.add("bbb");
source.add("ccc");
Assert.assertFalse(StringListUtils.containsNull(source));
source.set(1, null);
Assert.assertTrue(StringListUtils.containsNull(source));
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment