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

org.fugerit.java.dsb.DataServiceWrapper Maven / Gradle / Ivy

The newest version!
package org.fugerit.java.dsb;

import java.io.IOException;
import java.io.InputStream;

import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.ToString;

/**
 * 

Class wrapping another DataService

*/ @NoArgsConstructor @RequiredArgsConstructor @ToString public class DataServiceWrapper implements DataService { @NonNull private DataService dataService; /** *

Unwrap the inner DataService.

* * @return the wrapped DataService */ public DataService unwrap() { return this.dataService; } /** *

Wrap this DataService around another.

* * @param dataService the DataService to wrap */ public void wrap( DataService dataService ) { this.dataService = dataService; } @Override public InputStream load(String id) throws IOException { return this.unwrap().load(id); } @Override public String save(InputStream data) throws IOException { return this.unwrap().save(data); } @Override public String save(InputStream data, String resourceName) throws IOException { return this.unwrap().save(data, resourceName); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy