2
0
Fork 0

added files

This commit is contained in:
Willem Cazander 2014-08-23 16:59:26 +02:00
parent 90b81deb29
commit fc4c568b18
11 changed files with 484 additions and 0 deletions

View file

@ -0,0 +1,80 @@
/*
* Copyright 2007-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.vasc.backend;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
/**
* AbstractVascBackendResult.
*
* @author Willem Cazander
* @version 1.0 Aug 23, 2014
*/
abstract public class AbstractVascBackendResult<DATA_OBJECT extends Serializable> implements VascBackendResult<DATA_OBJECT> {
private final List<DATA_OBJECT> pageData;
private final long totalSize;
private final Map<String, Serializable> pageSummary;
private final Map<String, Serializable> totalSummary;
public AbstractVascBackendResult(List<DATA_OBJECT> pageData,long totalSize,Map<String, Serializable> pageSummary,Map<String, Serializable> totalSummary) {
this.pageData = pageData;
this.totalSize = totalSize;
this.pageSummary = pageSummary;
this.totalSummary = totalSummary;
}
/**
* @see net.forwardfire.vasc.backend.VascBackendResult#getPageData()
*/
@Override
public List<DATA_OBJECT> getPageData() {
return pageData;
}
/**
* @see net.forwardfire.vasc.backend.VascBackendResult#getTotalSize()
*/
@Override
public long getTotalSize() {
return totalSize;
}
/**
* @see net.forwardfire.vasc.backend.VascBackendResult#getPageSummary()
*/
@Override
public Map<String, Serializable> getPageSummary() {
return pageSummary;
}
/**
* @see net.forwardfire.vasc.backend.VascBackendResult#getTotalSummary()
*/
@Override
public Map<String, Serializable> getTotalSummary() {
return totalSummary;
}
}

View file

@ -0,0 +1,46 @@
/*
* Copyright 2007-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.vasc.backend;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
/**
* DefaultVascBackendResult.
*
* @author Willem Cazander
* @version 1.0 Aug 23, 2014
*/
public final class DefaultVascBackendResult<DATA_OBJECT extends Serializable> extends AbstractVascBackendResult<DATA_OBJECT> {
public DefaultVascBackendResult(List<DATA_OBJECT> pageData) {
this(pageData,-1,null,null);
}
public DefaultVascBackendResult(List<DATA_OBJECT> pageData, long totalSize,
Map<String, Serializable> pageSummary,
Map<String, Serializable> totalSummary) {
super(pageData, totalSize, pageSummary, totalSummary);
}
}

View file

@ -0,0 +1,41 @@
/*
* Copyright 2007-2012 forwardfire.net All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.forwardfire.vasc.backend;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
/**
* VascBackendResult.
*
* @author Willem Cazander
* @version 1.0 Aug 23, 2014
*/
public interface VascBackendResult<DATA_OBJECT extends Serializable> {
List<DATA_OBJECT> getPageData();
long getTotalSize();
Map<String,Serializable> getPageSummary();
Map<String,Serializable> getTotalSummary();
}