001/* 002 * JKNIV, SQLegance keeping queries maintainable. 003 * 004 * Copyright (C) 2017, the original author or authors. 005 * 006 * This library is free software; you can redistribute it and/or 007 * modify it under the terms of the GNU Lesser General Public 008 * License as published by the Free Software Foundation; either 009 * version 2.1 of the License. 010 * 011 * This library is distributed in the hope that it will be useful, 012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 014 * Lesser General Public License for more details. 015 * 016 * You should have received a copy of the GNU Lesser General Public 017 * License along with this library; if not, write to the Free Software Foundation, Inc., 018 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 019 */ 020package net.sf.jkniv.sqlegance.builder.xml; 021 022import net.sf.jkniv.sqlegance.Statistical; 023 024/** 025 * Dummy/Empty implementation for {@link Statistical} 026 * 027 * @author Alisson Gomes 028 * @since 0.6.0 029 * 030 */ 031public class NoSqlStats implements Statistical 032{ 033 private final static Statistical NO_STATS = new NoSqlStats(); 034 035 private NoSqlStats() 036 { 037 } 038 039 public static Statistical getInstance() 040 { 041 return NO_STATS; 042 } 043 044 @Override 045 public void add(long time) {} 046 047 @Override 048 public void add(Exception e) {} 049 050 @Override 051 public long getMaxTime() 052 { 053 return 0; 054 } 055 056 @Override 057 public long getMinTime() 058 { 059 return 0; 060 } 061 062 @Override 063 public long getAvgTime() 064 { 065 return 0; 066 } 067 068 @Override 069 public long getTotalTime() 070 { 071 return 0; 072 } 073 074 @Override 075 public long getFirstTime() 076 { 077 return 0; 078 } 079 080 @Override 081 public long getLastTime() 082 { 083 return 0; 084 } 085 086 @Override 087 public long getCount() 088 { 089 return 0; 090 } 091 092 @Override 093 public long getTotalException() 094 { 095 return 0; 096 } 097 098 @Override 099 public Exception getFirstException() 100 { 101 return null; 102 } 103 104 @Override 105 public Exception getLastException() 106 { 107 return null; 108 } 109 110 @Override 111 public String toString() 112 { 113 return "NoSqlStats [maxTime=0, minTime=0, avgTime=0, totalTime=0, getFirstTime=0" 114 + ", lastTime=0, count=0, totalException=0, firstException=null, lastException=null]"; 115 } 116 117 118 119}