001/* 002 * Copyright 2019 nils.hoffmann. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package de.isas.lipidomics.domain; 017 018import de.isas.lipidomics.palinom.exceptions.ConstraintViolationException; 019import lombok.AllArgsConstructor; 020import lombok.Data; 021 022/** 023 * A generic lipid fragment. There is currently no further specialization in 024 * fragment handling available, since the nomenclature is still not standardized 025 * in a way that would allow for generic detection of fragment-specific 026 * features. 027 * 028 * @author nils.hoffmann 029 */ 030@AllArgsConstructor 031@Data 032public class Fragment { 033 034 private static final class None extends Fragment { 035 036 private None() { 037 super(""); 038 } 039 } 040 041 public static final Fragment NONE = new None(); 042 043 private final String name; 044 045 /** 046 * Returns the string representation of this fragment. 047 * 048 * @return the fragment string. 049 */ 050 public String getLipidString() { 051 return name; 052 } 053}