001// Generated by delombok at Sun Jul 30 17:21:56 UTC 2023 002package de.cuioss.test.jsf.mocks; 003 004import java.io.Serializable; 005import java.util.Arrays; 006import javax.el.ELContext; 007import javax.el.MethodExpression; 008import javax.el.MethodInfo; 009 010/** 011 * @author Oliver Wolff 012 */ 013public class CuiMockMethodExpression extends MethodExpression { 014 private static final long serialVersionUID = 2692860324272056192L; 015 /** 016 * Indicates whether method was invoked. 017 */ 018 private boolean invoked = false; 019 /** 020 * Parameters method was invoked with. 021 */ 022 private transient Object[] invokedParams; 023 /** 024 * Result to be returned on {@link #invoke(ELContext, Object[])} 025 */ 026 private Serializable invokeResult; 027 private transient MethodInfo methodInfo; 028 private String expressionString; 029 private boolean literalText = false; 030 031 @Override 032 public MethodInfo getMethodInfo(final ELContext context) { 033 return methodInfo; 034 } 035 036 @Override 037 public Object invoke(final ELContext context, final Object[] params) { 038 invoked = true; 039 invokedParams = Arrays.copyOf(params, params.length); 040 return invokeResult; 041 } 042 043 @java.lang.Override 044 @java.lang.SuppressWarnings("all") 045 @lombok.Generated 046 public boolean equals(final java.lang.Object o) { 047 if (o == this) return true; 048 if (!(o instanceof CuiMockMethodExpression)) return false; 049 final CuiMockMethodExpression other = (CuiMockMethodExpression) o; 050 if (!other.canEqual((java.lang.Object) this)) return false; 051 if (this.isInvoked() != other.isInvoked()) return false; 052 if (this.isLiteralText() != other.isLiteralText()) return false; 053 final java.lang.Object this$invokeResult = this.invokeResult; 054 final java.lang.Object other$invokeResult = other.invokeResult; 055 if (this$invokeResult == null ? other$invokeResult != null : !this$invokeResult.equals(other$invokeResult)) return false; 056 final java.lang.Object this$expressionString = this.getExpressionString(); 057 final java.lang.Object other$expressionString = other.getExpressionString(); 058 if (this$expressionString == null ? other$expressionString != null : !this$expressionString.equals(other$expressionString)) return false; 059 return true; 060 } 061 062 @java.lang.SuppressWarnings("all") 063 @lombok.Generated 064 protected boolean canEqual(final java.lang.Object other) { 065 return other instanceof CuiMockMethodExpression; 066 } 067 068 @java.lang.Override 069 @java.lang.SuppressWarnings("all") 070 @lombok.Generated 071 public int hashCode() { 072 final int PRIME = 59; 073 int result = 1; 074 result = result * PRIME + (this.isInvoked() ? 79 : 97); 075 result = result * PRIME + (this.isLiteralText() ? 79 : 97); 076 final java.lang.Object $invokeResult = this.invokeResult; 077 result = result * PRIME + ($invokeResult == null ? 43 : $invokeResult.hashCode()); 078 final java.lang.Object $expressionString = this.getExpressionString(); 079 result = result * PRIME + ($expressionString == null ? 43 : $expressionString.hashCode()); 080 return result; 081 } 082 083 @java.lang.Override 084 @java.lang.SuppressWarnings("all") 085 @lombok.Generated 086 public java.lang.String toString() { 087 return "CuiMockMethodExpression(invoked=" + this.isInvoked() + ", invokedParams=" + java.util.Arrays.deepToString(this.getInvokedParams()) + ", invokeResult=" + this.invokeResult + ", methodInfo=" + this.methodInfo + ", expressionString=" + this.getExpressionString() + ", literalText=" + this.isLiteralText() + ")"; 088 } 089 090 /** 091 * Indicates whether method was invoked. 092 */ 093 @java.lang.SuppressWarnings("all") 094 @lombok.Generated 095 public boolean isInvoked() { 096 return this.invoked; 097 } 098 099 /** 100 * Indicates whether method was invoked. 101 */ 102 @java.lang.SuppressWarnings("all") 103 @lombok.Generated 104 public void setInvoked(final boolean invoked) { 105 this.invoked = invoked; 106 } 107 108 /** 109 * Parameters method was invoked with. 110 */ 111 @java.lang.SuppressWarnings("all") 112 @lombok.Generated 113 public Object[] getInvokedParams() { 114 return this.invokedParams; 115 } 116 117 /** 118 * Result to be returned on {@link #invoke(ELContext, Object[])} 119 */ 120 @java.lang.SuppressWarnings("all") 121 @lombok.Generated 122 public void setInvokeResult(final Serializable invokeResult) { 123 this.invokeResult = invokeResult; 124 } 125 126 @java.lang.SuppressWarnings("all") 127 @lombok.Generated 128 public void setMethodInfo(final MethodInfo methodInfo) { 129 this.methodInfo = methodInfo; 130 } 131 132 @java.lang.SuppressWarnings("all") 133 @lombok.Generated 134 public String getExpressionString() { 135 return this.expressionString; 136 } 137 138 @java.lang.SuppressWarnings("all") 139 @lombok.Generated 140 public void setExpressionString(final String expressionString) { 141 this.expressionString = expressionString; 142 } 143 144 @java.lang.SuppressWarnings("all") 145 @lombok.Generated 146 public boolean isLiteralText() { 147 return this.literalText; 148 } 149 150 @java.lang.SuppressWarnings("all") 151 @lombok.Generated 152 public void setLiteralText(final boolean literalText) { 153 this.literalText = literalText; 154 } 155}