-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #271 from netgrif/NAE-2008
[NAE-2008] Serialisation of classes
- Loading branch information
Showing
8 changed files
with
49 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
...if/application/engine/petrinet/domain/dataset/logic/validation/LocalizedValidation.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 19 additions & 4 deletions
23
...n/java/com/netgrif/application/engine/workflow/web/responsebodies/DataFieldsResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,33 @@ | ||
package com.netgrif.application.engine.workflow.web.responsebodies; | ||
|
||
import com.netgrif.application.engine.petrinet.domain.dataset.Field; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import org.springframework.hateoas.CollectionModel; | ||
|
||
import java.util.ArrayList; | ||
import java.io.Serializable; | ||
import java.util.Collection; | ||
import java.util.Iterator; | ||
import java.util.Locale; | ||
import java.util.stream.Collectors; | ||
|
||
public class DataFieldsResource extends CollectionModel<LocalisedField> { | ||
@Setter | ||
@Getter | ||
public class DataFieldsResource extends CollectionModel<LocalisedField> implements Serializable, Iterable<LocalisedField> { | ||
|
||
private static final long serialVersionUID = 73213276016133399L; | ||
|
||
private Collection<LocalisedField> content; | ||
|
||
public DataFieldsResource(Collection<Field> content, Locale locale) { | ||
super(content.stream() | ||
super(); | ||
this.content = content.stream() | ||
.map(f -> LocalisedFieldFactory.from(f, locale)) | ||
.collect(Collectors.toList()), new ArrayList<>(), null); | ||
.collect(Collectors.toList()); | ||
} | ||
|
||
@Override | ||
public Iterator<LocalisedField> iterator() { | ||
return this.content.iterator(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters