/*
* Copyright (C) 2005-2010 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Alfresco. If not, see
* While the short-string version of the value is always lowercase, the CRC is * calculated from the virgin string if case-sensitivity is enforced; in the case-insensitive * case, the CRC is calculated from a lowercase version of the string. *
* If the value is an empty string, then {@link #EMPTY_STRING} is used instead. This ensures
* that persisted values don't fall foul of the Oracle empty string comparison "behaviour" i.e
* you should never persist an empty string in Oracle as it equates to a SQL NULL.
*
* @param value the raw value that will be persisted
* @param dataLength the maximum number of characters that can be persisted
* @param useCharsFromStart true if the shortened string value must be made from
* the first characters of the string or false to use
* characters from the end of the string.
* @param caseSensitive true if the resulting pair must be case-sensitive or
* false if the pair must be case-insensitive.
* @return Return the persistable pair. The result will never be null,
* but the individual pair values will be null if the
* value given is null
*/
public static Pair