question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is it possible to do this kind of transfer ?

See original GitHub issue

Input: { "AA": [ { "A": "10", "B": "20", "C": "90", "D": "10" } ] }

Expected Output: { "AA": [ { "A": "red", "B": "yellow", "C": "black", "D": "red" } ] }

Question: Can we do a logic check in the spec? to get the expected result

  • if the value <=10, return red,
  • if the value >10, value <90 return yellow
  • if the value >=90, return black.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
milosimpsoncommented, Aug 25, 2018

Start simple / don’t need a spec driven transform.

This is assuming that the input data is just a single top level map with “A”, “B”, etc as keys.

public class MyTransform implements Transform {

  @Override
  public Object transform(Object input) {
     if ( ! input instanceof Map) {  return input; }

    Map<String, Object> inputMap = (Map<String,Object>) input;

    // psudocode
    int A = Integer.valueOf( inputMap.get("A") );

    if ( A <= 10 ) {
       inputMap.put("A", "red" );
    }
    /// etc
  }
}
1reaction
milosimpsoncommented, Aug 20, 2018

Yes, but you would have to write it. Implement the Transform Interface.

And then you can call your Transform by using it’s fully qualified class name as the “operation”.

Something like

[
  {
    "operation": "shift",
    "spec": {
      ...
    }
  },
  {
    "operation": "com.example.jolt.RedYellowBlackTransform"
  },
  {
    "operation": "default",
    "spec": {
      ...
    }
  }
]
Read more comments on GitHub >

github_iconTop Results From Across the Web

In-Kind Transfer: What It Is and How to Do It Correctly
For an in-kind transfer of investments, that means those investments are transferred to a new company, and there's no need to buy or...
Read more >
What Is an In Kind Transfer? - SmartAsset.com
An in kind transfer isn't a complicated concept. It simply means that you move your assets from one brokerage account to another brokerage...
Read more >
What is the Significance of Information Transfer? - Study.com
Positive transfer is when knowledge or skills about a previous topic help a student learn a new skill or learn about a new...
Read more >
Can You Do an In-Kind Transfer Into an IRA? - The Motley Fool
In-kind transfers from regular taxable brokerage accounts: not allowed. The biggest question in deciding whether you can do an in-kind transfer into an...
Read more >
Energy Transfers and Transformations
Energy cannot be created or destroyed, but it can be transferred and transformed. There are a number of different ways energy can be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found