All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.molr.commons.domain.dto.StrandDto Maven / Gradle / Ivy

package io.molr.commons.domain.dto;

import io.molr.commons.domain.Strand;

import static java.util.Objects.requireNonNull;

public class StrandDto {

    public final String id;

    public StrandDto(String id) {
        this.id = requireNonNull(id, "id must not be null");
    }

    public StrandDto() {
        this.id = null;
    }

    @Override
    public String toString() {
        return "StrandDto{" +
                "id='" + id + '\'' +
                '}';
    }

    public static StrandDto from(Strand strand) {
        return new StrandDto(strand.id());
    }

    public Strand toStrand() {
        return Strand.ofId(id);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy