0

I have a class called ExportExcelCell that I assign to a generic type

package com.morningstar.portfolioservice.domain.export;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.morningstar.portfolioservice.utils.export.ColumnDataType;

public class ExportExcelCell<T> {

@JsonProperty("text")
private T text;

@JsonProperty("style")
private String style;

@JsonProperty("cellRowSpan")
private Integer cellRowSpan;

@JsonProperty("cellColSpan")
private Integer cellColSpan;

@JsonProperty("cellAlignment")
private String cellAlignment;


private String cellVerticalAlignment;


@JsonProperty("cellFontName")
private String cellFontName;

@JsonProperty("cellFontSize")
private Short cellFontSize;

@JsonProperty("cellFontColor")
private Short cellFontColor;

@JsonProperty("cellType")
private ColumnDataType cellType;

@JsonProperty("cellNumericFormat")
private String cellNumericFormat;

@JsonProperty("cellDateFormat")
private String cellDateFormat;


public ExportExcelCell() {

}

public T getText() {
    return text;
}

public void setText(Ttext) {
    this.text = text;
}

public String getStyle() {
    return style;
}

public void setStyle(String style) {
    this.style = style;
}

public Integer getCellRowSpan() {
    return cellRowSpan;
}

public void setCellRowSpan(int cellRowSpan) {
    this.cellRowSpan = cellRowSpan;
}

public Integer getCellColSpan() {
    return cellColSpan;
}

public void setCellColSpan(int cellColSpan) {
    this.cellColSpan = cellColSpan;
}

public String getCellAlignment() {
    return cellAlignment;
}

@JsonProperty("cellVAlignment")
public String getCellVerticalAlignment() {
    return cellVerticalAlignment;
}

public void setCellVerticalAlignment(String cellVerticalAlignment) {
    this.cellVerticalAlignment = cellVerticalAlignment;
}

public void setCellAlignment(String exportExcelDefaultCellAlignment) {
    this.cellAlignment = exportExcelDefaultCellAlignment;
}

public String getCellFontName() {
    return cellFontName;
}

public void setCellFontName(String cellFontName) {
    this.cellFontName = cellFontName;
}

public Short getCellFontSize() {
    return cellFontSize;
}

public void setCellFontSize(Short cellFontSize) {
    this.cellFontSize = cellFontSize;
}

public Short getCellFontColor() {
    return cellFontColor;
}

public void setCellFontColor(Short cellFontColor) {
    this.cellFontColor = cellFontColor;
}


public ColumnDataType getCellType() {
    return cellType;
}

public void setCellType(ColumnDataType cellType) {
    this.cellType = cellType;
}

public String getCellNumericFormat() {
    return cellNumericFormat;
}

public void setCellNumericFormat(String cellNumericFormat) {
    this.cellNumericFormat = cellNumericFormat;
}

public String getCellDateFormat() {
    return cellDateFormat;
}

public void setCellDateFormat(String cellDateFormat) {
    this.cellDateFormat = cellDateFormat;
}

@Override
public String toString() {
    return "ExportExcelCell [text=" + text + ", style=" + style
            + ", cellRowSpan=" + cellRowSpan + ", cellColSpan="
            + cellColSpan + ", cellAlignment=" + cellAlignment
            + ", cellVerticalAlignment=" + cellVerticalAlignment
            + ", cellFontName=" + cellFontName + ", cellFontSize="
            + cellFontSize + ", cellFontColor=" + cellFontColor
            + ", cellType=" + cellType + ", cellNumericFormat="
            + cellNumericFormat + ", cellDateFormat=" + cellDateFormat
            + "]";
}

}

And the class is called in ExportCellRow and The class ExportCellRow is called in ExportExcellSegment and the class ExportExcellSegment is called in ExportExcelSheet.

I get a warning when I don't assign the generic to ExportExcelCell inside ExportCellRow.

the warning is ExportExcelCell is a raw type. References to generic type ExportExcelCell should be parameterized

Is there a way to only assign the generic type to ExportExcelCell or maybe in ExportCellRow without having to do that in all the other classes that i mentioned above since I only need the generic type in ExportExcelCell ?

joe80
  • 11
  • 4

0 Answers0