Tabnine Logo
HollowEffigyFactory
Code IndexAdd Tabnine to your IDE (free)

How to use
HollowEffigyFactory
in
com.netflix.hollow.diffview.effigy

Best Java code snippets using com.netflix.hollow.diffview.effigy.HollowEffigyFactory (Showing top 7 results out of 315)

origin: Netflix/hollow

List<Field> createFields(HollowEffigy effigy) {
  switch(effigy.dataAccess.getSchema().getSchemaType()) {
  case OBJECT:
    return createObjectFields(effigy);
  case LIST:
  case SET:
    return createCollectionFields(effigy);
  case MAP:
    return createMapFields(effigy);
  }
  
  throw new IllegalArgumentException();
}

origin: Netflix/hollow

public List<Field> getFields() {
  if(fields == null)
    fields = factory.createFields(this);
  return fields;
}
origin: Netflix/hollow

public HollowDiffViewRow getHollowDiffViewRows() {
  HollowEffigy fromEffigy, toEffigy;
  if(diffUI != null && diffUI.getCustomHollowEffigyFactory(typeName) != null) {
    CustomHollowEffigyFactory effigyFactory = diffUI.getCustomHollowEffigyFactory(typeName);
    synchronized(effigyFactory) {
      effigyFactory.setFromHollowRecord(fromDataAccess.getTypeDataAccess(typeName), fromOrdinal);
      effigyFactory.setToHollowRecord(toDataAccess.getTypeDataAccess(typeName), toOrdinal);
      effigyFactory.generateEffigies();
      fromEffigy = effigyFactory.getFromEffigy();
      toEffigy = effigyFactory.getToEffigy();
    }
  } else {
    HollowEffigyFactory effigyFactory = new HollowEffigyFactory();
    fromEffigy = fromOrdinal == -1 ? null : effigyFactory.effigy(fromDataAccess, typeName, fromOrdinal);
    toEffigy = toOrdinal == -1 ? null : effigyFactory.effigy(toDataAccess, typeName, toOrdinal);
  }
  HollowDiffViewRow rootRow = createRootRow(fromEffigy, toEffigy);
  traverseEffigyToCreateViewRows(rootRow);
  return rootRow;
}
origin: Netflix/hollow

  break;
case REFERENCE:
  fieldValue = effigy(typeDataAccess.getDataAccess(), schema.getReferencedType(i), typeDataAccess.readOrdinal(effigy.ordinal, i));
  field = memoize(field);
origin: Netflix/hollow

private List<Field> createCollectionFields(HollowEffigy effigy) {
  List<Field> fields = new ArrayList<Field>();
  HollowCollectionTypeDataAccess typeDataAccess = (HollowCollectionTypeDataAccess) effigy.dataAccess;
  HollowCollectionSchema schema = typeDataAccess.getSchema();
  HollowOrdinalIterator iter = typeDataAccess.ordinalIterator(effigy.ordinal);
  int elementOrdinal = iter.next();
  while(elementOrdinal != NO_MORE_ORDINALS) {
    HollowEffigy elementEffigy = effigy(typeDataAccess.getDataAccess(), schema.getElementType(), elementOrdinal);
    fields.add(new Field("element", elementEffigy));
    elementOrdinal = iter.next();
  }
  
  return fields;
}
origin: Netflix/hollow

@Test
public void test() throws IOException {
  HollowDiff diff = new FakeHollowDiffGenerator().createFakeDiff();
  HollowEffigyFactory effigyFactory = new HollowEffigyFactory();
  HollowEffigy fromEffigy = effigyFactory.effigy(diff.getFromStateEngine(), "TypeA", 0);
  HollowEffigy toEffigy = effigyFactory.effigy(diff.getToStateEngine(), "TypeA", 0);
  HollowEffigyDiffRecord diffRecord = new HollowEffigyDiffRecord(fromEffigy);
  Assert.assertEquals(8, diffRecord.calculateDiff(toEffigy, 8));
}
origin: Netflix/hollow

private List<Field> createMapFields(HollowEffigy effigy) {
  List<Field> fields = new ArrayList<Field>();
  HollowMapTypeDataAccess typeDataAccess = (HollowMapTypeDataAccess)effigy.dataAccess;
  HollowMapSchema schema = typeDataAccess.getSchema();
  HollowMapEntryOrdinalIterator iter = typeDataAccess.ordinalIterator(effigy.ordinal);
  while(iter.next()) {
    HollowEffigy entryEffigy = new HollowEffigy("Map.Entry");
    entryEffigy.add(new Field("key", effigy(typeDataAccess.getDataAccess(), schema.getKeyType(), iter.getKey())));
    entryEffigy.add(new Field("value", effigy(typeDataAccess.getDataAccess(), schema.getValueType(), iter.getValue())));
    fields.add(new Field("entry", "Map.Entry", entryEffigy));
  }
  
  return fields;
}
com.netflix.hollow.diffview.effigyHollowEffigyFactory

Most used methods

  • <init>
  • effigy
  • createCollectionFields
  • createFields
  • createMapFields
  • createObjectFields
  • memoize

Popular in Java

  • Running tasks concurrently on multiple threads
  • onRequestPermissionsResult (Fragment)
  • onCreateOptionsMenu (Activity)
  • requestLocationUpdates (LocationManager)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • Path (java.nio.file)
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Join (org.hibernate.mapping)
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now