Skip to content

Commit

Permalink
add retrofit defintions (#253)
Browse files Browse the repository at this point in the history
* add retrofit defintions

* update structural

* more getter setter and json properties

* use embedded

* licence header

* duplicate entry in changelog
  • Loading branch information
longshuicy authored Feb 20, 2024
1 parent 982cb3f commit 6aa78d4
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

### Added
- Add retrofit information to the mapping set class [#252](https://github.com/IN-CORE/incore-services/issues/252)

## [1.24.0] - 2024-02-07

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*******************************************************************************
* Copyright (c) 2024 University of Illinois and others. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Mozilla Public License v2.0 which accompanies this distribution,
* and is available at https://www.mozilla.org/en-US/MPL/2.0/
*
* Contributors:
* Chen Wang
*/

package edu.illinois.ncsa.incore.service.dfr3.models;

import com.fasterxml.jackson.annotation.JsonProperty;
import dev.morphia.annotations.Embedded;

@Embedded
public class MappingEntryKey {
private String name;
private String description;
private Boolean defaultKey;

@JsonProperty("config")
private MappingEntryKeyConfig config;

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getDescription(){
return description;
}

public void setDescription(String description){
this.description = description;
}

public Boolean getDefaultKey(){
return defaultKey;
}

public void setDefaultKey(Boolean defaultKey){
this.defaultKey = defaultKey;
}

public MappingEntryKeyConfig getConfig(){
return config;
}

public void setConfig(MappingEntryKeyConfig config){
this.config = config;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*******************************************************************************
* Copyright (c) 2024 University of Illinois and others. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Mozilla Public License v2.0 which accompanies this distribution,
* and is available at https://www.mozilla.org/en-US/MPL/2.0/
*
* Contributors:
* Chen Wang
*/

package edu.illinois.ncsa.incore.service.dfr3.models;

import dev.morphia.annotations.Embedded;

@Embedded
public class MappingEntryKeyConfig {
private String unit;
private String type;
private String targetColumn;
private String expression;

public String getUnit(){
return unit;
}

public void setUnit(String unit){
this.unit = unit;
}

public String getType(){
return type;
}

public void setType(String type){
this.type = type;
}

public String getTargetColumn(){
return targetColumn;
}

public void setTargetColumn(String targetColumn){
this.targetColumn = targetColumn;
}

public String getExpression(){
return expression;
}

public void setExpression(String expression){
this.expression = expression;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public class MappingSet {
private String creator;
private String owner;

private MappingEntryKey[] mappingEntryKeys;

/**
* spaces the object belongs to. Calculated at runtime.
*/
Expand Down Expand Up @@ -96,4 +98,12 @@ public String getMappingType() {
public void setMappingType(String mappingType) {
this.mappingType = mappingType;
}

public MappingEntryKey[] getMappingEntryKeys() {
return mappingEntryKeys;
}

public void setRetrofitDefinitions(MappingEntryKey[] mappingEntryKeys) {
this.mappingEntryKeys = mappingEntryKeys;
}
}

0 comments on commit 6aa78d4

Please sign in to comment.