CaseInsensitiveString is not a bad idea depends on your use, as long as you don't expect it to work together with String.
You may convert a CaseInsensitiveString to a String, or vice-versa, and that's all you should do.
Problem will happen if you try to do something like
class CaseInsensitiveString {
private String value;
public boolean equals(Object o) {
// .....
if (o instanceof String) {
return value.equalsIgnoreCase((String) o);
}
}
}
You are doomed to fail if you are going to make your CaseInsensitiveString corporate with normal String, because you will be violating symmetric-ness and transitive-ness for equals() (and other contracts)
However, please ask yourself, in what case you really need this CaseInsensitiveString which it is not suitable to use String.CASE_INSENSITIVE_ORDER ? I bet not many case. I am sure there will be case that worth having this special class, but ask yourself first.