Skip to content

Commit

Permalink
JBPM-9774: Create ComparablePeriodSerializer
Browse files Browse the repository at this point in the history
See related PR:
- kiegroup/jbpm#1947
  • Loading branch information
Jozef Marko committed Jun 14, 2021
1 parent f70c4d4 commit 3916640
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
10 changes: 10 additions & 0 deletions kie-dmn/kie-dmn-feel/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>

<!-- Tests -->
<dependency>
<groupId>junit</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright 2021 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.kie.dmn.feel.lang.types.impl;

import java.io.IOException;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;


public class ComparablePeriodSerializer extends StdSerializer<ComparablePeriod>{
public ComparablePeriodSerializer() {
this(null);
}

public ComparablePeriodSerializer(Class<ComparablePeriod> t) {
super(t);
}

@Override
public void serialize(ComparablePeriod v, JsonGenerator g, SerializerProvider sp) throws IOException {
sp.defaultSerializeValue(v.asPeriod(), g);
}

}

0 comments on commit 3916640

Please sign in to comment.