Git Product home page Git Product logo

cdm-clean-keys's Introduction

cdm-clean-keys

Utility to clean global keys in CDM JSON

Quick utility that will remove keys from a CDM JSON Object.

    // Load some data with global references
    ObjectMapper objectMapper = RosettaObjectMapper.getNewMinimalRosettaObjectMapper();
    BusinessEvent eventWithGlobalKeys = objectMapper.readValue(uri.toURL(), BusinessEvent.class);
    
    // Example for removing all global keys for a `BusinessEvent`
    ReferenceCleaner<BusinessEvent> referenceCleaner1 = new ReferenceCleaner<>(BusinessEvent.class);
    BusinessEvent eventWithNoGlobalKeys = referenceCleaner.removeGlobalKeys(eventWithGlobalKeys);

    // Example for removing all global keys for a `BusinessEvent` but keep the key for Trade
    ReferenceCleaner<BusinessEvent> referenceCleaner2 = new ReferenceCleaner<>(BusinessEvent.class, Trade.class);
    BusinessEvent eventWithOnlyTradeGlobalKeys = referenceCleaner2.removeGlobalKeys(eventWithGlobalKeys);

    // Example for removing all global keys for a `BusinessEvent` but keep the key for TradeState and Party
    ReferenceCleaner<BusinessEvent> referenceCleaner3 = new ReferenceCleaner<>(BusinessEvent.class, TradeState.class, Party.class);
    BusinessEvent eventWithOnlyTradeStateAndPartyGlobalKeys = referenceCleaner2.removeGlobalKeys(eventWithGlobalKeys);

cdm-clean-keys's People

Contributors

minesh-s-patel avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.