Package net.sf.joafip.store.entity

Examples of net.sf.joafip.store.entity.EnumKey


    BobContainer bobContainer = new BobContainer();
    EnumForTest enumForTest = EnumForTest.VAL1;
    enumForTest.setObject(null);
    bobContainer.setObject1(enumForTest);
    final Map<EnumKey, Enum<?>> storedEnumMap = new PTreeMap<EnumKey, Enum<?>>();
    storedEnumMap.put(new EnumKey(EnumForTest.VAL1), EnumForTest.VAL1);
    store.setRoot(bobContainer, storedEnumMap);
    store.save(true, false);

    DATA_MANAGER_INTEGRITY_CHECKER.checkIntegrity(dataManager);
View Full Code Here


    list = new PLinkedList<BobContainer>();
    BobContainer bobContainer;
    bobContainer = new BobContainer();
    // store.storedMutableEnum(EnumForTest.VAL1);
    Map<EnumKey, Enum<?>> storedEnumMap = new PTreeMap<EnumKey, Enum<?>>();
    storedEnumMap.put(new EnumKey(EnumForTest.VAL1), EnumForTest.VAL1);
    bobContainer.setObject1(EnumForTest.VAL1);
    list.add(bobContainer);
    store.setRoot(list, storedEnumMap);
    store.save(true, false);

    logger.info("second add val1");
    list = (PLinkedList<BobContainer>) store.readAndGetRoot();
    bobContainer = new BobContainer();
    // store.storedMutableEnum(EnumForTest.VAL1);
    bobContainer.setObject1(EnumForTest.VAL1);
    list.add(bobContainer);
    store.save(true, false);

    Iterator<BobContainer> iterator;

    logger.info("first val1 to val2");
    store.readRoot();
    list = (PLinkedList<BobContainer>) store.getRoot();
    storedEnumMap = store.getStoredEnumMap();
    // store.storedMutableEnum(EnumForTest.VAL1);
    storedEnumMap.put(new EnumKey(EnumForTest.VAL1), EnumForTest.VAL1);
    // store.storedMutableEnum(EnumForTest.VAL2);
    storedEnumMap.put(new EnumKey(EnumForTest.VAL2), EnumForTest.VAL2);
    iterator = list.iterator();
    assertTrue(MUST_HAVE_NEXT_ELEMENT, iterator.hasNext());
    bobContainer = iterator.next();
    assertEquals(BAD_VALUE, EnumForTest.VAL1, bobContainer.getObject1());
    bobContainer.setObject1(EnumForTest.VAL2);
View Full Code Here

      StoreClassNotFoundException, StoreDataCorruptedException,
      StoreTooBigForSerializationException {
    final EnumForTest enumForTest = EnumForTest.VAL1;
    final Map<EnumKey, Enum<?>> storedEnumMap = new PTreeMap<EnumKey, Enum<?>>();
    // store.storedMutableEnum(enumForTest);
    storedEnumMap.put(new EnumKey(EnumForTest.VAL1), EnumForTest.VAL1);
    final Bob1 bob1 = new Bob1();
    bob1.setVal(0);
    enumForTest.setObject(bob1);
    store.setRoot(enumForTest, storedEnumMap);
    store.save(true, false);
View Full Code Here

      StoreClassNotFoundException, StoreDataCorruptedException,
      StoreTooBigForSerializationException {
    store.setRecordSaveActions(true);
    // store.storedMutableEnum(EnumForTest.VAL1);
    final Map<EnumKey, Enum<?>> storedEnumMap = new PTreeMap<EnumKey, Enum<?>>();
    storedEnumMap.put(new EnumKey(EnumForTest.VAL1), EnumForTest.VAL1);
    final EnumForTest enumForTest = EnumForTest.VAL1;
    enumForTest.setObject(new Bob1());
    final BobContainer bobContainer = new BobContainer();
    bobContainer.setObject1(enumForTest);
    store.setRoot(bobContainer, storedEnumMap);
View Full Code Here

        /**/enumClass, "values", new Class<?>[] {}, new Object[] {});
        if (storedEnumMap == null) {
          storedEnumMap = new PTreeMap<EnumKey, Enum<?>>();
        }
        for (final Enum<?> enumValue : enumArray) {
          final EnumKey enumkey = new EnumKey(enumValue);// NOPMD
          storedEnumMap.put(enumkey, enumValue);
        }
      } catch (final ReflectException exception) {
        throw new FilePersistenceException(exception);
      }
View Full Code Here

  }

  @Override
  @Deprecated
  public void setEnumState(final Enum<?> enumObject) throws StoreException {
    final EnumKey enumKey = new EnumKey(enumObject);
    final Map<EnumKey, Enum<?>> enumMap = storeRoot.getStoredEnumMap();
    try {
      ProxyManager2.forceLoad(enumMap.get(enumKey));
    } catch (final Exception exception) {
      throw new StoreException(exception);
View Full Code Here

TOP

Related Classes of net.sf.joafip.store.entity.EnumKey

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.