Subversion Repository Public Repository

litesoft

Diff Revisions 765 vs 777 for /trunk/Java/GWT/Client/src/org/litesoft/GWT/client/localstorage/LocalStorageImpl.java

Diff revisions: vs.
  @@ -3,6 +3,7 @@
3 3 import java.util.*;
4 4
5 5 import org.litesoft.core.annotations.*;
6 + import org.litesoft.core.simpletypes.nonpublic.*;
6 7 import org.litesoft.core.util.*;
7 8
8 9 /**
  @@ -147,7 +148,7 @@
147 148 throw new NoSuchElementException();
148 149 }
149 150 String zKey = mHtml5LS.key( mNextIndex++ );
150 - return new SimpleImmutableEntry<String, String>( zKey, mHtml5LS.getItem( zKey ) );
151 + return new OurEntry( zKey, mHtml5LS.getItem( zKey ) );
151 152 }
152 153 }
153 154 };
  @@ -178,4 +179,57 @@
178 179 {
179 180 return UtilsCommon.assertNotNullNotEmpty( "Key", pKey );
180 181 }
182 +
183 + /**
184 + * Keys & Values can't be null!
185 + */
186 + private static class OurEntry implements Entry<String, String>
187 + {
188 + private final String mKey;
189 + private final String mValue;
190 +
191 + public OurEntry( String pKey, String pValue )
192 + {
193 + this.mKey = pKey;
194 + this.mValue = pValue;
195 + }
196 +
197 + public String getKey()
198 + {
199 + return mKey;
200 + }
201 +
202 + public String getValue()
203 + {
204 + return mValue;
205 + }
206 +
207 + public String setValue( String value )
208 + {
209 + throw new UnsupportedOperationException();
210 + }
211 +
212 + public boolean equals( Object o )
213 + {
214 + return (this == o) || ((o instanceof Map.Entry) && equals( (Map.Entry) o ));
215 + }
216 +
217 + public boolean equals( Map.Entry them )
218 + {
219 + return (this == them) || //
220 + ((them != null) && //
221 + mKey.equals( them.getKey() ) && //
222 + mValue.equals( them.getValue() ));
223 + }
224 +
225 + public int hashCode()
226 + {
227 + return EqualSupport.hashCodeEm( mKey.hashCode(), mValue.hashCode() );
228 + }
229 +
230 + public java.lang.String toString()
231 + {
232 + return mKey + "=" + mValue;
233 + }
234 + }
181 235 }