com.synopsys.integration.bdio.model.BdioIdAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of integration-bdio Show documentation
Show all versions of integration-bdio Show documentation
A library to allow for easy and clear creation of Black Duck I/O (bdio) documents.
/*
* integration-bdio
*
* Copyright (c) 2022 Synopsys, Inc.
*
* Use subject to the terms and conditions of the Synopsys End User Software License and Maintenance Agreement. All rights reserved worldwide.
*/
package com.synopsys.integration.bdio.model;
import java.io.IOException;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
public class BdioIdAdapter extends TypeAdapter {
@Override
public void write(JsonWriter writer, BdioId value) throws IOException {
writer.value(value.toString());
}
@Override
public BdioId read(JsonReader in) throws IOException {
return new BdioId(in.nextString());
}
}