Questions tagged [abstract]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
0 answers
179 views

Not able to access interface methods from an abstract class instance

I'm trying to build an Apex classes structure where I have two (or more) entities that have something in common but at the same time have a different set of fields. In the example below it's gonna be ...
Ilya Matsuev's user avatar
7 votes
1 answer
2k views

Invoking Interface Method in Abstract Class Method

Assume we have some interface, abstract class and contrete class: interface I { void foo(); void bar(); } abstract class A implements I { public void barFoo() { bar(); // Compile ...
Oleh Berehovskyi's user avatar
1 vote
1 answer
122 views

abstract base class to json structure

Prepare to cringe this is some poor implementation but in my defense I don't have any experience in this. I suppose this is a wrong way to use a constructor but I've been trying to achieve a structure ...
devoid_of_chill's user avatar
8 votes
2 answers
2k views

Cannot deserialize JSON as abstract type

When running a test that's deserializing a JSON string, I get the error message: Cannot deserialize JSON as abstract type: TestController.Item The JSON contains a list of objects which is abstract ...
Sabrina's user avatar
  • 243
0 votes
1 answer
665 views

Critical update error now showing up

Recently, Salesforce came out with a critical update to Restrict Reflective Access to Non-Global Constructors in Packages. The update is active in my org. My code uses Type.newInstance. I'm a bit ...
user2582622's user avatar
7 votes
1 answer
268 views

Is it possible to invoke "super" with less ambiguous results?

I have an abstract parent class with some dependency and a default implementation. The constructors might look like: public abstract class ParentClass { protected SomeDependency someDependency; ...
Brian Kessler's user avatar
1 vote
1 answer
875 views

How does object inheritance interact with sharing inheritance?

Let's say I have some class: public abstract without sharing MyUnsharingClass { // Some methods... } which is extended by public SomeClass extends MyUnsharingClass { // Some methods... } ...
Brian Kessler's user avatar
9 votes
2 answers
2k views

How to use @AuraEnabled base class method in Lightning Component?

We are consolidating our common methods into an Abstract controller base class. Here's an example: public abstract class CommunityControllerBase { /* Returns a select option list of ...
Swisher Sweet's user avatar
1 vote
0 answers
42 views

State transfer between abstract extensible component and lightning:isUrlAddressable

I've got a little problem and thinking I might have designed my component a little incorrectly. I'm storing quite a bit of state in an abstract extensible component for convenience. I've noticed if I ...
dzh's user avatar
  • 4,016
14 votes
2 answers
2k views

Can create an Instance of Abstract Class, Salesforce Bug?

I was playing with Apex and stumbled upon this. Created an Abstract Class and made the constructor as private, so that noone can create an instance of it. This works just fine during compilation. it ...
Pranay Jaiswal's user avatar
4 votes
2 answers
443 views

How can I upsert a homogeneous List<SObject>, in a good way? [duplicate]

I have some abstracted code, which at the end of some process will create a homogeneous list of SObjects. It could be a list of Accounts, it could be a list of contacts, it could be a list of some ...
Brian Kessler's user avatar
0 votes
0 answers
464 views

Utility methods failing with 'cannot call test methods in non-test context'

I generate a number of different email notifications from Cases, with variations depending on Account location, for example. They've morphed from basic workflow email templates in order to gather ...
Duncan Stewart's user avatar
5 votes
0 answers
279 views

Using abstract component to iterate sub-component - how to correctly bind state?

I have this idea for a generic component that would allow adding, deleting and copying entries in the form - abstract component handles adding, cloning, etc, while your main component holds actual ...
dzh's user avatar
  • 4,016
2 votes
1 answer
1k views

Abstract Class with Generic Type?

Is there a way I can implement something like an abstract class with a generic type? For example, I want to be able to write code like the following (I know there are issues there). The main error I ...
Marty C.'s user avatar
  • 4,399