Questions tagged [mapper]

The mapper is the first step in MapReduce framework, a component of a larger scalable, parallel-izable algorithm.

Maps input key/value pairs to a set of intermediate key/value pairs.

Maps are the individual tasks which transform input records into a intermediate records. The transformed intermediate records need not be of the same type as the input records. A given input pair may map to zero or many output pairs.

The most common map reduce framework is Apache Hadoop.

See also MapReduce Wiki.

653 questions
46
votes
4 answers

How to efficiently map a org.json.JSONObject to a POJO?

I'm using a 3rd party library to retrieve data in JSON format. The library offers the data to me as a org.json.JSONObject. I want to map this JSONObject to a POJO (Plain Old Java Object) for simpler access/code. For mapping, I currently use the…
Daniel S.
  • 6,458
  • 4
  • 35
  • 78
29
votes
16 answers

MapStruct - @Mapper annotation don't create bean

I downloaded application from this source https://github.com/springframeworkguru/spring5-mvc-rest/tree/vendor-api And I have a problem with MapStruct. @Mapper public interface CategoryMapper { CategoryMapper INSTANCE =…
Kutti
  • 486
  • 1
  • 6
  • 17
23
votes
2 answers

Mapping XML Entities to Java Objects

I am quite sure, this is one of the many duplicated questions around XML to Java Object conversions. But I started this thread since I couldn't find simpler or looking for simpler solution. I have an xsd [Infact I am designing it] and xml. I would…
RaceBase
  • 18,428
  • 47
  • 141
  • 202
21
votes
1 answer

Is a mapper a version of the adapter pattern

I have been trying to get my head around the adapter pattern, out of all the patterns it's the hardest for me to imagine a use for it. I think I understand what is achieved, to me it is to convert an object to another interface so a client can use…
berimbolo
  • 3,319
  • 8
  • 43
  • 78
20
votes
3 answers

Is there something like AutoMapper for Scala?

I have been looking for some scala fluent API for mapping object-object, similar to AutoMapper. Are there such tools in Scala?
mrcaramori
  • 2,503
  • 4
  • 29
  • 47
20
votes
6 answers

Convert json string without quotes into a map

I have a string that is in Json format, only none of the keys or values are surrounded by quotes. For example, I have this: String json = "{name: Bob, state: Colorado, Friends: [{ name: Dan, age: 23 }, {name: Zane, age: 24 }]}" I want this to…
user2869231
  • 1,431
  • 5
  • 24
  • 53
18
votes
4 answers

MyBatis executing multiple sql statements in one go, is that possible?

i was wondering if it is possible to execute multiple sql statements in 1 go. For example the scenario that i want to delete rows from multiple tables, is there a way i can do things like.. DELETE FROM…
Marco
  • 15,101
  • 33
  • 107
  • 174
18
votes
2 answers

Difference between jackson objectMapper to others

I can't find any explanation about difference between jackson's ObjectMapper to other mappers like dozer/mapStruct/modelMapping/etc. All the articles compare dozer/mapStruct/modelMapping but they ignore ObjectMapper. I can't understand what is…
Plaggyy
  • 219
  • 1
  • 2
  • 8
16
votes
2 answers

Java: Unmapped target properties

I have a problem with Mapper.I am using a mapstruct-processor to build Maven project. All time I get a warning: Warning:(15, 16) java: Unmapped target properties: "from, to". Warning:(13, 13) java: Unmapped target properties: "clientFrom,…
Błażej Rejnowski
  • 239
  • 1
  • 2
  • 8
15
votes
4 answers

C# generics based object to object mapper question

I have the need for an object to object mapper in my application. I've tried out a few, but haven't been able to find anything that fits my needs, so I'm writing my own. Currently I have an interface like below: public interface IMapper { …
Brian
  • 1,027
  • 2
  • 11
  • 17
14
votes
1 answer

Multi-language elastic search mapping setup

I have documents stored in MongoDB like so: const demoArticle = { created: new Date(), title: [{ language: 'english', value: 'This is the english title' }, { language: 'dutch', value: 'Dit is de nederlandse titel' }] } I…
randomKek
  • 1,108
  • 3
  • 18
  • 34
13
votes
3 answers

How do I rename files when included in a jar by ant's jar task?

I want to put a set of files that look like this into a jar: yay/my.jar boo/my.jar foo/my.jar bar/my.jar In the process, I want all of them renamed as follows: yay_my.jar boo_my.jar foo_my.jar bar_my.jar I was hoping to use a mapper to accomplish…
skiphoppy
  • 97,646
  • 72
  • 174
  • 218
10
votes
3 answers

Jackson Mapping List of String or simple String

I'm trying to get some Json from an API and parse them into some POJO's to work with them but i have this case where i can get for a key a simple String or an arrayList of Strings. The Json looks like this : { "offerDisplayCategoryMapping": [ …
Habchi
  • 1,921
  • 2
  • 22
  • 50
10
votes
1 answer

Jackson Library JSON Mapper to String

I have a class (A and B are my objects) public A { private List b; private int c; } I have a String variable temp. So i would save in this variable the JSON String of my object. How? I've tried with this 2 method, but without…
user2520969
  • 1,389
  • 6
  • 20
  • 30
9
votes
2 answers

Exception java.util.LinkedHashMap cannot be cast to java.util.List

While working around following code I got the exception given below. List> obj = mapper.readValue(result.getBody(), new TypeReference>(){}); for (Map map : obj) { for(Map.Entry
Vamsi
  • 619
  • 3
  • 9
  • 22
1
2 3
43 44